ocarina/libsaria/collection/__init__.py

26 lines
451 B
Python

# Bryan Schumaker (8/8/2010)
__all__ = ["collection"]
import libsaria
import tagpy
call = libsaria.event.call
exists = libsaria.path.exists
expand = libsaria.path.expand
FileRef = tagpy.FileRef
LIBRARY = 0
PLAYLIST = 1
QUEUE = 2
import collection
source = collection.Collection()
def new_source(path, bg=True):
global source
path = expand(path)
if not exists(path):
return 0
return call("NEWSOURCE", source.scan, arg=path, bg=bg)