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
Bryan Schumaker
fff834a14c
Find file_id for a given path
...
Finding the id of a file shouldn't be the job of the library. Instead,
it should exist as part of the path minipulation code.
2010-12-05 13:29:10 -05:00
Bryan Schumaker
3e0b8de257
Rename library.sources
...
I think that "locations" is a better name than "sources". Also, it
avoids the confusion of library sources and current track sources.
2010-12-05 13:11:31 -05:00
Bryan Schumaker
6b92d199e2
Only back up changed files
...
We only need to back up files with a score != 0 and count != 0
2010-12-03 08:36:13 -05:00
Bryan Schumaker
e5f85fab5c
Library importing
...
I can now import both v1.1 and v1.2 libraries. I split this into
appropriate functions for each version.
2010-12-03 08:36:13 -05:00
Bryan Schumaker
e9fe8321af
Backup sources and improvements
...
I already have a "dumb import" (retag all files based on the filepath)
so there is no point in storing extra attributes when I am only going to
find them again during importing. Instead, we should only store the
information we need: filepath, score, and playcount.
Additionally, I now store the list of sources in the library backup.
2010-12-03 08:36:13 -05:00
Bryan Schumaker
72f85f9f92
Create a set locked function for album art
...
We appear to already be locked when we get to the setter function. I
was getting deadlocked when trying to do anything. To fix this, I
made it so I can set images without needing the lock.
2010-12-03 08:35:15 -05:00
Bryan Schumaker
bb8632cf69
Albumart set from local file
...
I can pass the file location to the lastfm module to set the artwork
from a local file rather than from a web location.
2010-12-03 08:35:14 -05:00
Bryan Schumaker
0cbf344fa6
Cache delete items
...
I can now delete things from the cache in addition to adding things.
2010-12-03 08:35:14 -05:00
Bryan Schumaker
8fa2c29fa5
Import old library
...
I can now import files from an Ocarina 4.1 library exported as xml.
Ocarina 4.2 keeps track of a list of sources, but 4.1 does not. For
importing to work properly, the library needs to be rescanned before
running the import. The import will set the playcount and score
attributes for each file.
2010-12-03 08:35:14 -05:00
Bryan Schumaker
9e82d32489
Move lastfm to path/
2010-12-03 08:31:03 -05:00
Bryan Schumaker
487e8c39be
Move generic saving / loading functions
...
These belong under path/
2010-12-03 08:31:03 -05:00
Bryan Schumaker
80deb45a3e
Move cache into path/
...
The cache modifies files, so it can be part of path/
2010-12-03 08:31:03 -05:00
Bryan Schumaker
1e7f63aa2d
Moved backup.py to path/
...
This moves the backup functions to a more reasonable place.
2010-12-03 08:31:03 -05:00
Bryan Schumaker
36cf384cf2
Import trees from libsaria.trees
2010-12-03 08:30:14 -05:00
Bryan Schumaker
dcc5a937ae
Added basename() to path
...
This will be useful for finding the file referred to by a path.
2010-12-03 08:30:13 -05:00
Bryan Schumaker
0719a57270
Moved libsaria.path to a package
...
This is the beginning of moving file related code into a single package
and out of the main libsaria directory.
2010-12-03 08:30:13 -05:00