diff --git a/src/core/create.py b/src/core/create.py index 01a6eb99..f9bc95c8 100644 --- a/src/core/create.py +++ b/src/core/create.py @@ -20,8 +20,8 @@ import settings # Called every time the plugin is enabled def open(): - settings.set("curlib",-1) - pass + if settings.has("curlib") == False: + settings.set("curlib",-1) # Called every time the plugin is stopped diff --git a/src/core/load.py b/src/core/load.py index 5249e25c..ad5ebbd4 100644 --- a/src/core/load.py +++ b/src/core/load.py @@ -43,15 +43,4 @@ def run(args=None): else: join = ' ' gstreamer.load(join.join(args)) - #filename = expandPath(args[0]) - #if checkPath(filename) == False: - # return - - #write("loading file: "+filename) - #bin = gst.element_factory_make("playbin", None) - #bin.set_property("uri", "file://"+filename) - #bin.set_state(gst.STATE_PAUSED) - - #pipeline = gst.Pipeline("player") - #pipeline.add(bin) diff --git a/src/core/next.py b/src/core/next.py index b85b5348..b90ed6cb 100644 --- a/src/core/next.py +++ b/src/core/next.py @@ -31,21 +31,24 @@ def next(): # Called every time the plugin is enabled def open(): - settings.set("current",0) + if settings.has("current") == False: + settings.set("current",0) settings.set("next",next) - pass # Called every time the plugin is stopped def close(): + settings.delete("next") pass # Called when the plugin needs to perform some action def run(args=None): - id = settings.get("next")() + if settings.has("curlib") == False: + return curlib = str(settings.get("curlib")) - + id = settings.get("next")() + database.open() a = database.select("path","library","id="+curlib).fetchone()[0] b = database.select("path","track","id="+str(id)).fetchone()[0] diff --git a/src/core/rand.py b/src/core/rand.py index 6aa19016..c3d88853 100644 --- a/src/core/rand.py +++ b/src/core/rand.py @@ -24,8 +24,8 @@ def next(): # Called every time the plugin is enabled def open(): - settings.set("random",False) - pass + if settings.has("random") == False: + settings.set("random",False) # Called every time the plugin is stopped