Bryan Schumaker
1f84f2755b
libsaria: Fix playlist num_visible()
...
When the playlist is changed, I need to test song ids against the
visible set to get the correct number
2011-05-29 14:59:29 -04:00
Bryan Schumaker
114ac13c7a
libsaria: Added TODO idea to playlist
...
I want to do type checking after loading objects. This can be done once
during storage.load_obj, rather than after load_obj
2011-05-28 15:40:19 -04:00
Bryan Schumaker
d7ba67ee38
libsaria: Remove oldlibrary usage from playlist
...
The idea is to remove this from everywhere. The playlist is a good
start.
2011-05-23 09:05:56 -04:00
Bryan Schumaker
de1acd8a23
libsaria: Playlist filtering and next() fixes
...
I removed the old playlist filtering code, since I now have a generic
way of doing this. I also fixed the next function to use the revised
get_attrs() function.
2011-05-22 10:14:10 -04:00
Bryan Schumaker
531ceb2c17
libsaria: Rename library.py to oldlibrary.py
...
I want to preserve the old library as I slowly introduce the new one.
This should help.
2011-05-20 21:22:21 -04:00
Bryan Schumaker
6d01a1cbc8
libsaria: Fix playlist filtering
...
The variables "filtered" and "visible" are global, so we need to tell
the function that it shouldn't create local variables.
2011-05-16 12:04:28 -04:00
Bryan Schumaker
76975ecead
libsaria: Fix spacing in playlist
2011-05-15 11:02:14 -04:00
Bryan Schumaker
32a1e96af0
libsaria: Remove unused global statements and imports
...
With my recent cleanups, I don't need these statements anymore. To do
this, I also had to move tracking recent songs to next.py
2011-05-15 10:59:31 -04:00
Bryan Schumaker
6d5ca5d416
libsaria: Rename queue and playlist list functions
...
I rename them from list() to list_ids() so that it doesn't clobbel the
list constructor.
2011-05-15 10:53:31 -04:00
Bryan Schumaker
b4eb7c15c5
libsaria: Remove unused playlist functions
...
I have more generic play_id() and load_id() functions now, so the
playlist specific implementations haven't been used in a long time. I
don't think I need them anymore.
2011-05-15 10:50:39 -04:00
Bryan Schumaker
5a781479cd
libsaria: Move rand_next() to playlist's next.py
...
This keeps code for picking the next song in one place. I also cleaned
up rand_next() while I was at it.
2011-05-15 10:30:22 -04:00
Bryan Schumaker
0f78c7b80c
libsaria: Add idea to playlist
...
I want one file to grab the lock and another with functions to call with
the lock held.
2011-05-14 08:29:55 -04:00
Bryan Schumaker
a3af3d053d
libsaria: New sequential next function for playlist
...
The new function exists in its own file to keep things simpler. Based
on the current song id, it finds the index in the playlist and returns
the next visible song.
2011-05-14 08:15:05 -04:00
Bryan Schumaker
0a1160f618
libsaria: Rename playlist's next() function
...
This is to prepare for creating a new file "next.py" dedicated to
choosing the next song. I also use this as an opportunity to pass the
current song id to the next function.
2011-05-14 07:48:11 -04:00
Bryan Schumaker
a950f06e10
libsaria: Don't always keep a set of visible songs
...
If the playlist isn't filtered there isn't much of a point in keeping
around a set of visible songs.
2011-05-13 22:54:27 -04:00
Bryan Schumaker
9056daae93
libsaria: Remove playlist startup() function
...
I should be able to do this on import, so it doesn't need its own
function.
2011-05-13 08:27:59 -04:00
Bryan Schumaker
202e75430e
libsaria: Add comment to playlist save()
...
The lock should be held while saving. Save should normally be called by
a function that already holds the lock, though.
2011-05-13 08:19:50 -04:00
Bryan Schumaker
ad7f780671
libsaria: Load playlist on import
...
I was doing this during startup already, so I might as well do it here.
2011-05-13 08:07:47 -04:00
Bryan Schumaker
194b436886
libsaria: Clean up playlist init
...
I removed some code that really didn't need to be used. I also moved
around some of the imports to make the file easier to follow.
2011-05-13 08:03:00 -04:00
Bryan Schumaker
132a66271c
libsaria: Move playlist load, save, and reset functions
...
I moved them to playlist.py so they can grab the lock and safely do
stuff. I save after adding or removing song ids. I also save after
resetting the playlist.
2011-05-12 22:34:36 -04:00
Bryan Schumaker
8b51871225
libsaria: Playlist uses new list functions
...
They were built in to the sources/ layer in 4.6. It makes sense to use
them for the playlist.
2011-05-12 08:25:44 -04:00
Bryan Schumaker
2afabfcf21
libsaria: remove ids from playlist (improved!)
...
I moved this to my new file. I grab the lock, remove each id, and then
unlock.
2011-05-12 08:11:35 -04:00
Bryan Schumaker
8bd914802e
libsaria: Move playlist's list to new file
...
It will be easier to work with from a new file, especially after I put
in functions for doing basic operations on it.
2011-05-11 23:05:47 -04:00
Bryan Schumaker
e2be97165e
libsaria: Move playlist to new directory
...
This will help me manage it better. My next task is to explode it into
multiple files.
2011-05-11 22:43:32 -04:00