Commit Graph

24 Commits

Author SHA1 Message Date
Anna Schumaker 7b89f54e8b scanner: Remove the ImportTask
It is no longer needed now that we have updated from the tagdb

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-28 15:49:52 -05:00
Anna Schumaker a85ac03517 db: Occasionally optimize the database
I do this whenever we commit during scanning, and during application
shutdown.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-09 22:09:40 -05:00
Anna Schumaker 0b818bc067 db: Attach release information to albums
This lets us sort albums by original release date, so if an artist
releases multiple albums in a year we can sort by month too.
Additionally, this helps us better handle albums with the same name that
were released in different years.

Implements: #40 (Store the full date in the year table)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-11-18 10:20:24 -05:00
Anna Schumaker 3d77e8cd2a scanner: Give ImportTasks a "playlists" argument
So users don't need to re-create their playlists when switching over to
the sqlite database.

Implements: #10 (Import user playlists)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-11-18 10:20:24 -05:00
Anna Schumaker 8f98dfdde7 scanner: Create an EnableLibraryTask
For enabling or disabling library paths through an idle task

Implements: Issue #37 (Create an Idle Task to enable / disable library paths)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-11-18 10:20:24 -05:00
Anna Schumaker 5ff03cf33f db: Give MappedPlaylists add_track() and remove_track() functions
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-10-18 15:50:07 -04:00
Anna Schumaker 063b93b66f db: Convert the TrackTable into a table.Table
Implements: Issue #11 (Cache database items fields)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-10-15 16:09:59 -04:00
Anna Schumaker 67238ed385 db: Give Albums a find_disc() function
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-10-14 17:03:19 -04:00
Anna Schumaker 737d135d41 db: Give Artists a find_album() function
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-10-14 13:22:57 -04:00
Anna Schumaker a1f54839bb db: Convert the AlbumTable into a playlist.ChildModel
Implements: Issue #11 (Cache database items fields)
Implements: Issue #14 (Convert Tables into Gio.ListModels)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-10-14 13:22:57 -04:00
Anna Schumaker 90c6593921 db: Give Decades a find_year() function
And adjust the Year table and Track table to take a Decade as an
argument.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-10-14 13:22:57 -04:00
Anna Schumaker 4141ca211c db: Convert the YearTable into a playlist.ChildModel
Implements: Issue #11 (Cache database items fields)
Implements: Issue #14 (Convert Tables into Gio.ListModels)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-10-14 13:22:57 -04:00
Anna Schumaker a4fbd5f2f3 db: Rename playlist.py -> user.py
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-10-11 11:58:43 -04:00
Anna Schumaker 9cf1df7c33 db: Move SQLite Connection stuff into a new file
I find this cleaner than importing from the toplevel module

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-10-07 13:58:09 -04:00
Anna Schumaker da78887783 scanner: Add a RemoveLibraryScheduler task
For breaking the tracklist into chunks, and then following up their
removal with a library table removal

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-08-26 17:11:12 -04:00
Anna Schumaker 88ebde085b scanner: Add a RemoveLibraryTask
For removing a library's database entry

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-08-26 17:11:08 -04:00
Anna Schumaker 0f57b10500 scanner: Add a RemoveTask
For unconditionally removing a list of tracks

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-08-26 17:11:05 -04:00
Anna Schumaker 19278af3b8 scanner: Add a CheckSchedulerTask
This task breaks a library's tracks into chunks and schedules a
CheckTask for each chunk.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-08-26 17:11:02 -04:00
Anna Schumaker 8946df3ce4 scanner: Add a CheckTask for checking if tracks still exist
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-08-26 17:10:59 -04:00
Anna Schumaker 7ea14392ec scanner: Add a DirectoryTask
For iterating through a directory and creating tasks based on the files
found. I had to add a subdirectory to the Test Album to make sure
subdirs are handled properly here.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-08-26 17:10:55 -04:00
Anna Schumaker 9cced017ad scanner: Add an ImportTask
For importing tracks from the tagdb

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-08-26 17:10:27 -04:00
Anna Schumaker 3402ce16ee scanner: Add a new FileTask for scanning music files
This task is also responsible for checking if the file already exists in
the database before scanning.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-08-26 17:06:58 -04:00
Anna Schumaker 91d0922518 scanner: Add a CommitTask
For committing the database during scanning

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-08-26 17:06:55 -04:00
Anna Schumaker 065c192714 scanner: Add a base class for queued Tasks
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-08-26 17:06:52 -04:00