stump icon indicating copy to clipboard operation
stump copied to clipboard

Support a small set of library patterns

Open aaronleopold opened this issue 2 years ago • 0 comments

I would like to add support for selecting between two generalized library structure patterns that will affect how Stump determines what is a series. The naming I am considering currently is Collection Based Library vs Series Based Library, but I don't love the latter.

Note: For the time being this option will not be reversible for a library. If you create a library with one pattern, Stump will not let you change it afterwards. This is because if you change how Stump defines a series in your library after having created the series, then it will potentially result in lost and/or duplicated data, as well as disconnects from other DB relations (e.g. read progress, reading lists, etc). In the future, I might add a migration tool to support this switch,

Collection based libraries, during a scan, will take the top most folder and collapse everything into that as a single series. I personally like this for my ebook collection since I have /Author/Series/novel_file and /Author/novel_file.

The series based library would effectively be the opposite, creating series from the bottom-most level.

Consider the following:

.LIBRARY ROOT
└── Top Level Folder
    └── Publisher
        ├── Some Category / Folder
        │   └── A Cool Comic 001.cbz
        └── Some Category / Folder 2
            └── Some Comic 001.cbz

The collection based library would create a single series, Top Level Folder:

Top Level Folder
├── A Cool Comic 001.cbz
└── Some Comic 001.cbz

The series based library will create two series Some Category / Folder and Some Category / Folder 2:

Some Category / Folder
└── A Cool Comic 001.cbz

Some Category / Folder 2
└── Some Comic 001.cbz

Core tasks:

  • [x] add libraryPattern to prisma schema (part of LibraryOptions)
  • [x] create enum LibraryPattern
    • [x] default to SeriesBasedLibrary
  • [x] take in create API endpoint
  • [x] use configured option in during scan

Interface tasks:

  • [x] add option to library creation modal
  • [x] send through corresponding API functions

aaronleopold avatar Sep 16 '22 22:09 aaronleopold