Commit Graph

21 Commits

Author SHA1 Message Date
Anna Schumaker 98ef8bf3f3 scanner: Add shortcuts for creating widgets
These use the global queue instance to create appropriate widgets with
the same name.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-08-30 11:34:19 -04:00
Anna Schumaker 5f6f3f9f42 scanner: Create a global Queue instance
And some convenience functions for using it

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-08-30 11:13:49 -04:00
Anna Schumaker e09d892a46 scanner: Create a custom AddFolderButton widget
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-08-30 11:13:49 -04:00
Anna Schumaker 0157b1d4c0 scanner: Create a custom DirectoryChooser widget
It is set up to view and select directories only, with a shortcut added
for the user's Music directory.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-08-30 11:13:49 -04:00
Anna Schumaker 7535b71724 scanner: Create a custom UpdateAllButton widget
For updating all libraries in the database.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-08-30 11:13:49 -04:00
Anna Schumaker 8f837b40c1 scanner: Create a custom RemoveButton widget
For removing a specific library from the database.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-08-30 11:13:49 -04:00
Anna Schumaker 5e08088462 scanner: Create a custom UpdateButton widget
When clicked, it updates a specific Library instance

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-08-30 11:13:49 -04:00
Anna Schumaker 94b53aff5f scanner: Create a custom ProgressBar widget
For use tracking the progress we make through the TaskQueue

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-08-30 11:13:49 -04:00
Anna Schumaker a102087ece scanner: Create a TaskQueue
For running tasks with a GLib idle callback

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-08-30 11:13:48 -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
Anna Schumaker 73646fc106 scanner: Have Metadata gracefully handle self.file == NULL
So we don't need to wrap the context manager in a try / except block

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-08-26 17:06:50 -04:00
Anna Schumaker a28d4d4b8e scanner: Copy the Metadata code from lib/
And add an extra function for disc subtitles.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-08-26 17:06:47 -04:00