Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Allow Multiple Formats / Versions #196

Open
jacobkossman opened this issue Nov 19, 2023 · 5 comments
Open

[FEATURE] Allow Multiple Formats / Versions #196

jacobkossman opened this issue Nov 19, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@jacobkossman
Copy link

Is your feature request related to a problem? Please describe.
When you have two versions of the same book (eg a PDF and an epub version) it currently just lists them next to each other. For example when on desktop I can use PDF but on my phone I'd like to use epub so I don't have to zoom into the PDF etc.

Describe the solution you'd like
Ideally it would merge them into the same item and allow you to pick which one to read when clicking read. For me it would be nice if it could somehow automatically do this based on the folder it's in. For example:

Series/
  Harry Potter/
    Harry Potter and the Sorcerer's Stone/
      Harry Potter and the Sorcerer's Stone.epub
      Harry Potter and the Sorcerer's Stone.pdf
    Harry Potter and the Chamber of Secrets/
      Harry Potter and the Chamber of Secrets.epub
      Harry Potter and the Chamber of Secrets.pdf
    Harry Potter and the Prisoner of Azkaban.epub

It should recognize the two formats and combine them into one book for Sorcerer's Stone and Chamber but not Prisoner for example, but I'm not sure if this is possible with the way the structure is already set up.

Describe alternatives you've considered
Perhaps just a .stump hidden file that marks the items in the folder as mergable or something if the folder structure above won't work.

@jacobkossman jacobkossman added the enhancement New feature or request label Nov 19, 2023
@aaronleopold
Copy link
Collaborator

aaronleopold commented Nov 26, 2023

Is there any metadata you'd want to be able to associate with the relations, as well? For example, add a notes field or something that provides extra details on the relationship. Your example usecase is relating the same media together, but I could also see this as being useful for collections of research papers, etc.

@jacobkossman
Copy link
Author

My use case would only be as duplicates (or potentially "editions") of the same exact book. so i know there are comic book variants with different covers, or books that have different editions / editing etc.

For metadata, I think that's a whole other beast and probably a different feature request. But my ideal would be allowing users to rename, pick the series, pick the number in the series regardless of where in the file / folder structure it is.

@github-project-automation github-project-automation bot moved this to Backlog in v0.1.x Jan 21, 2024
@aaronleopold
Copy link
Collaborator

I've been thinking about this recently and wanted to dump an idea I had here for when I am able to try and support this down the road. Basically, the idea would be to completely overhaul the representation of media in the DB so that media itself is more of a grouping than a concrete entity. So a single media entry might refer to 1+ books. Having thought this through, this kind of restructure would be ideal if audio support is ever added down the road (#177), as well.

An example schema might look something like:

model Series {
  id String @id @default(uuid())

  name String

  // ... other stuff

  media Media[] // <-- Same as today
}

model Media {
  id String @id @default(uuid())

  name String // derived from ?? aggregate of book names? or just first book name? or ???

  series    Series? @relation(fields: [series_id], references: [id], onDelete: Cascade)
  series_id String?

  books      Book[] // <-- diverging from what exists today
  audiobooks AudioBook[] // <-- diverging from what exists today

  @@map("media")
}

model Book { // <-- diverging from what exists today
  id String @id @default(uuid())

  name String // derived from filename
  size Int // in bytes

  // ... other stuff

  media    Media  @relation(fields: [media_id], references: [id], onDelete: Cascade)
  media_id String

  metadata BookMetadata?

  // ... other stuff

  @@map("books")
}

model AudioBook { // <-- diverging from what exists today
  id String @id @default(uuid())

  media    Media  @relation(fields: [media_id], references: [id], onDelete: Cascade)
  media_id String

  @@map("audiobooks")
}

model BookMetadata { // <-- diverging from what exists today
  id String @id @default(cuid())

  // ... other stuff

  book    Book?   @relation(fields: [book_id], references: [id], onDelete: Cascade)
  book_id String? @unique
}

The biggest unknown for me would then be resolving metadata between instances of books. How would reconciling multiple books and their own corresponding metadata work? Merge? Some sort of priority? Etc. Regardless, just thought dumping for the future

@tonicastillo
Copy link

Hi!
I love this project and I just saw this feature idea.
I know it's a bit old, but I just wanted to add that if it's done, it would be a perfect opportunity to add the possibility of allowing multiple languages of the same book as well: Formats, versions, languages...
My family is bilingual, and in many cases we have books in two or three languages.

If this multi-language feature of a book were implemented, the folder structure solution is less useful because the name is different depending on the language. The idea of a tag that relates them seems better to me.

Sorry if I'm getting into something that doesn't concern me.
Thanks for this great project. It's what I've always been looking for.

@aaronleopold
Copy link
Collaborator

aaronleopold commented Mar 4, 2025

If this multi-language feature of a book were implemented, the folder structure solution is less useful because the name is different depending on the language. The idea of a tag that relates them seems better to me

That's a really solid point, thank you! I'll keep it in mind once I am able to actually start planning this feature more concretely. As I outlined above, it would involve very large breaking changes, so I'm waiting until more of the core features are implemented before tackling these bigger ones

Sorry if I'm getting into something that doesn't concern me

You're not! This is the point of an open source, community-driven project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Backlog
Development

No branches or pull requests

3 participants