Commit Graph

66 Commits

Author SHA1 Message Date
Bryan Schumaker 9be5b10112 libsaria: Clear cur_id when loading file
This allows me to return the correct attributes for a random song loaded
by the user.
2011-06-23 10:21:24 -04:00
Bryan Schumaker 7319767ac3 libsaria: Don't automatically create cache file
The cache filler function will pass back a string to be written to this
file.  If this string != None, then I create the file and fill it.
2011-06-18 09:39:55 -04:00
Bryan Schumaker 97902d0730 libsaria: Remove print statement
I added it for debugging.  I don't need it anymore.
2011-06-17 23:53:01 -04:00
Bryan Schumaker e8e0c5d743 libsaria: Return album art as part of all_attrs()
If the album art exists, I might as well return it so it can be set in
the main gtk thread.  If it doesn't exist, I'll trigger a web search for
it.
2011-06-17 23:42:20 -04:00
Bryan Schumaker 12cb9a900a libsaria: Switch most code to use all_attrs()
all_attrs() is my new way of doing things, so it makes sense to use it
now.
2011-06-17 20:23:32 -04:00
Bryan Schumaker 5a735aa625 libsaria: Clear cur_id correctly
I do this if the song isn't found in the library, rather than as part of
opening a track from disk.
2011-06-16 18:53:27 -04:00
Bryan Schumaker e0ad57c541 libsaria: Fix playing songs from outside of library
The song was loading, but attributes weren't updating.  I also use this
patch to begin playback when a song is loaded (I was tired of manually
pressing play every time)
2011-06-09 08:35:02 -04:00
Bryan Schumaker 071257d77d libsaria: Fix saving playlists
I was still using old functions, rather than my new ones.
2011-05-29 18:22:29 -04:00
Bryan Schumaker 1cbb1fb969 libsaria: Remove more path code 2011-05-26 16:04:07 -04:00
Bryan Schumaker 07c673fa47 libsaria: Remove unused libsaria.path code
I eventually want to get rid of this directory, so removing this code
helps.
2011-05-26 15:55:59 -04:00
Bryan Schumaker 6398b3dd9a libsaria: Find attributes for songs not in library
I use the same Track() class that the library does.  I have to create
an instance of this class each time the function is called, but this is
ok since it is not the case I am trying to optimize for.
2011-05-26 09:18:43 -04:00
Bryan Schumaker 6b0ccce530 libsaria: Remove oldlibrary from export code 2011-05-24 07:58:47 -04:00
Bryan Schumaker 913ee9f931 libsaria: Remove library export and import
Using export / import functions for library updates can be a pain.  I
don't plan on changing the library file format any time soon, so I don't
need to keep this code around.
2011-05-23 10:04:05 -04:00
Bryan Schumaker 8debb4a508 libsaria: Began library scanning routines
I can add a new path to a dictionary, but I don't do any actual scanning
yet.  Instead, I just print out each path in the library.
2011-05-21 07:16:00 -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 86f4aca8f3 libsaria: Remove old threads.py module
Everything in here can easily be duplicated with one line of python
code.  Keeping this file does a good job at increasing complexity.
2011-05-08 10:58:41 -04:00
Bryan Schumaker e2233e4106 libsaria: Remove old cache code
I've replaced it with a cache implemented in libsaria/storage.  The new
cache should be easier to use (or at least easier to maintain and
understand).
2011-05-07 17:10:20 -04:00
Bryan Schumaker bafdc6ef20 libsaria: Manually set artwork through a copy_in_file() function
I created this function in the cache to make a generic way to copy
outside files into the cache tree.  It makes sense to do this in the
cache, since I want to keep everything self-contained.
2011-05-07 16:49:41 -04:00
Bryan Schumaker 2a78d870ee libsaria: Set artwork from a local file
I set it in the new cache, rather than using the old one.
2011-05-07 16:45:04 -04:00
Bryan Schumaker 0f1b5550aa libsaria: Change cache_func() argument order
I want to pass the file object last, I just think it looks better.
2011-05-07 15:58:33 -04:00
Bryan Schumaker a7c7b85fdb libsaria: Get album art through new cache
I am working on replacing my old cache functions with something easier
to use.  I can now get album art out of the new cache.
2011-05-07 15:58:33 -04:00
Bryan Schumaker 904b475363 libsaria: Began new cache functions
I think the new cache will be more generic, and should work for just
about anything.  We'll see.
2011-05-07 15:58:33 -04:00
Bryan Schumaker c1a2d74f7c libsaria: Move version information to new file
A bit of separation is good here, and it should help with managing the
code.
2011-05-07 15:58:33 -04:00
Bryan Schumaker e64f93ef39 libsaria: New library source callback
Triggered upon scanning a new path to add to the library.
2011-05-01 12:46:17 -04:00
Bryan Schumaker bc54ef0a98 libsaria: Add a load_playlist() callback
Called when playlists are loaded from file.
2011-05-01 12:46:17 -04:00
Bryan Schumaker 96b237631e libsaria: Remove POSTSETART event
Nothing was listening for it, and I am removing the event system soon
anyway
2011-05-01 12:46:17 -04:00
Bryan Schumaker d0198cdd1a libsaria: Get artwork when songs are loaded
I may change this to something that has to be requested by the front
end, rather than always fetching it.  We'll see.
2011-05-01 12:46:17 -04:00
Bryan Schumaker 063869c7ca libsaria: Remove old file management code
I have new code for loading / saving objects, so I can remove the old
stuff.
2011-05-01 12:46:16 -04:00
Bryan Schumaker dc8a69bc0d ocarina: Refresh library after loading
To show changes.  I also use the v1.3 decoder function to decode
exported libraries.
2011-05-01 12:27:30 -04:00
Bryan Schumaker 3d1b8773d5 ocarina: Added album art
I put it on the now playing page for now.  Eventually I'll put it in
other places, too.
2011-05-01 12:19:49 -04:00
Bryan Schumaker 212a846d8c libsaria: Cache removes path if it exists
I wasn't checking if the path exists before removing it, and this caused
an error.  Checking before removing is simple enough, though...
2011-05-01 11:59:29 -04:00
Bryan Schumaker 0c636bfd56 Clean up universal_open()
The cleaned up version chooses what function to call based on file
extention.  I use map.get() to pick a function, and use the open_music()
function as the default.
2010-12-27 12:06:22 -05:00
Bryan Schumaker 270d33d5ec Reset playlist before loading xspf file
Loading an xspf file should replace the current playlist, rather than
add to it.
2010-12-18 16:45:48 -05:00
Bryan Schumaker aa0f832356 Refresh the playlist after loading
After we load an xspf file, we should refresh the playlist to reflect
changes.
2010-12-18 16:44:18 -05:00
Bryan Schumaker da99d4b349 Load xspf playlists
This patch adds loading of xspf playlists
2010-12-18 16:39:17 -05:00
Bryan Schumaker 77f065b703 Export playlist to xspf
This patch adds support for saving a playlist as an xspf xml file.  I
only use the <location> tag to keep it simple.
2010-12-18 16:22:06 -05:00
Bryan Schumaker 8d423629be Add fewer library sources
If we are being asked to add a path that is a subdirectory of a current
library source then we shouldn't add it.
2010-12-18 15:28:53 -05:00
Bryan Schumaker 3c2f40c69e Move backup.py -> export.py, import v1.3 library
The move was supposed to be in the previous patch ... oops.

This one also adds in importing a v1.3 library xml file.
2010-12-18 15:03:24 -05:00
Bryan Schumaker f869b17e2f Rename backup functions
Backup has been renamed to export
Restore has been renamed to import_xml
2010-12-18 14:52:31 -05:00
Bryan Schumaker c08655c1fa More reformatting and comments 2010-12-18 14:49:35 -05:00
Bryan Schumaker c49a39ad46 Encode v1.3 library
This patch changes the encode functions to export a v1.3 library
2010-12-18 14:46:31 -05:00
Bryan Schumaker cafc19fbed Don't set score when importing library
The score system has been replaced with a like / dislike system.  Score
is no longer an attribute that can be set.
2010-12-18 14:36:21 -05:00
Bryan Schumaker 8349efe8c7 Library export formatting changes
This patch rearranges the decode functions to put decoders for a single
version together.  I also removed some extra whitespace and clearly
labeled the decoding sections.
2010-12-18 14:33:17 -05:00
Bryan Schumaker b6c9c12ea9 Remove datetime module import
This was added to test timing changes for my recent pickle improvements.
2010-12-16 11:02:32 -05:00
Bryan Schumaker 84eb73d2a2 Pickling improvements
By using pickle correctly, I can now load in files significantly faster
than the old way.  Library loading times have gone from about 3 seconds
to 0.25 seconds.  I like this.
2010-12-16 09:29:06 -05:00
Bryan Schumaker d01d75cbe5 Find artwork using new get_attrs()
Using the new get_attrs() function makes things easier, and allows us to
find artwork for songs played that aren't in the library.
2010-12-12 08:55:30 -05:00
Bryan Schumaker 4749c49e16 Use the file source
When opening a file, we should use the file source instead of directly
loading it.
2010-12-07 20:47:32 -05:00
Bryan Schumaker f063da5b56 Began work on virtual sources
Virtual sources should make it easier to do things with the current song
without having to know anything about it (such as a song id or file
path).
2010-12-05 17:11:41 -05:00
Bryan Schumaker b6dba32e47 Rename file2id in backup
It is easier to use file_id
2010-12-05 13:42:23 -05:00
Bryan Schumaker 3eeb35d81c Stop using file_to_id
We should now use file_id located in libsaria.path
2010-12-05 13:40:39 -05:00