We could figure this out in the decade playlist code, but it's easier to
just do it inside the track itself.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
It is way faster during scanning due to the db key changes, which I
wasn't expecting at the time.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Largely inspired by the code in trak.map.py, but moved up to the
__init__.py file so callers don't need to go down another level.
Additionally, I change hashing to work with the track path rather than
tags which should simplify lookups a lot. A side effect of this is that
if playlists save each track's path in their pickle state, then we
should be able to recover from crashes by looking up the filepath during
the next load.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
The "tags" name doesn't really fit anymore now that we removed the Album
class. Let's change the name to something more accurate.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This was the only use of the chain() function, so let's just make a more
direct way of getting the information we want.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
- Clean up the code
- Kick off a GLib idle handler when events are added
- If we are already running in the main thread, then we don't need to
use the idle handler.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This is the first step in replacing the PlaylistNode. I can remove
common elements now, and future patches can continue the transition
between the two.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I leave the save and load code where it is for now, but I can split out
the rest of the code and add proper locking around the dictionary.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This gives us a wrapper to handle some tag extraction functions, rather
than implementing them in a Tag base class.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I'm going to be splitting this up into multiple files, and step one is
to create the directory.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Rather than doing this in multiple places outside of the track class.
Callers who want the original values can still dereference the value
directly
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Even though this is a ListModel the TreeModelFilter still tries to call
this function, so we need to define it to cut down on warnings printed
to the screen.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
The node view file has these extra newlines already, and I think it
makes everything easier to follow.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This playlist is only to showe new tracks added during the current
session, so we need to clear the list when getting the playlist state
dictionary.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
We only want to keep track of what has been played this session, so
clear out the list when we save
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I create a new notification for this so it can be queued without having
too many instances saving the same thing.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I use a reenterant lock so the same thread can use protected functions
in the class without a lot of code rewriting.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This is called for playlist initialization, resets, and unpicklings, so
it's a good place to put any common code that needs to happen during all
of these steps.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>