Browse files

Fix add_as_new_playlist bug and reenable the item

  • Loading branch information...
1 parent 2137230 commit cb262f11b6cb167d82756e46f89daa8e0832d593 Cyril Leclerc committed Dec 7, 2012
View
63 .project
@@ -1,34 +1,29 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>plugin.audio.qobuz2</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.python.pydev.PyDevBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>com.aptana.ide.core.unifiedBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>com.aptana.projects.webnature</nature>
- <nature>org.python.pydev.pythonNature</nature>
- </natures>
- <filteredResources>
- <filter>
- <id>1331459313201</id>
- <name></name>
- <type>22</type>
- <matcher>
- <id>org.eclipse.ui.ide.multiFilter</id>
- <arguments>1.0-name-matches-false-true-.*\.py(c|o)</arguments>
- </matcher>
- </filter>
- </filteredResources>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>plugin.audio.qobuz2</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.python.pydev.PyDevBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>com.aptana.projects.webnature</nature>
+ <nature>org.python.pydev.pythonNature</nature>
+ </natures>
+ <filteredResources>
+ <filter>
+ <id>1331459313201</id>
+ <name></name>
+ <type>22</type>
+ <matcher>
+ <id>org.eclipse.ui.ide.multiFilter</id>
+ <arguments>1.0-name-matches-false-true-.*\.py(c|o)</arguments>
+ </matcher>
+ </filter>
+ </filteredResources>
+</projectDescription>
View
24 .pydevproject
@@ -1,12 +1,12 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<?eclipse-pydev version="1.0"?>
-
-<pydev_project>
-<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
-<path>/plugin.audio.qobuzgithub</path>
-<path>/plugin.audio.qobuzgithub/resources/lib/qobuz</path>
-</pydev_pathproperty>
-<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.7</pydev_property>
-<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
-
-</pydev_project>
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?eclipse-pydev version="1.0"?>
+
+<pydev_project>
+<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
+<path>/plugin.audio.qobuz</path>
+<path>/plugin.audio.qobuz/resources/lib/qobuz</path>
+</pydev_pathproperty>
+<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.7</pydev_property>
+<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
+
+</pydev_project>
View
16 resources/lib/qobuz/bootstrap.py
@@ -307,15 +307,13 @@ def dispatch(self):
return False
return True
- #=======================================================================
- # elif self.MODE == Mode.PLAYLIST_ADD_AS_NEW:
- # from node.playlist import Node_playlist
- # node = Node_playlist(None, self.params)
- # if not node.add_as_new_playlist():
- # return False
- # return True
- #=======================================================================
-
+ elif self.MODE == Mode.PLAYLIST_ADD_AS_NEW:
+ from node.playlist import Node_playlist
+ node = Node_playlist(None, self.params)
+ if not node.add_as_new_playlist():
+ return False
+ return True
+
elif self.MODE == Mode.PLAYLIST_RENAME:
from node.user_playlists import Node_user_playlists
node = Node_user_playlists()
View
2 resources/lib/qobuz/constants.py
@@ -46,7 +46,7 @@ def to_s(self, mode):
elif mode == self.PLAYLIST_REMOVE_TRACK: return "playlist remove track"
elif mode == self.PLAYLIST_CREATE: return "playlist create"
elif mode == self.PLAYLIST_RENAME: return "playlist rename"
- # elif mode == self.PLAYLIST_ADD_AS_NEW: return "playlist add as new"
+ elif mode == self.PLAYLIST_ADD_AS_NEW: return "playlist add as new"
elif mode == self.PLAYLIST_ADD_TO_CURRENT: return "playlist add to current"
elif mode == self.PLAYLIST_SELECT_CURRENT: return "playlist select current"
else: return "Unknow mode: " + str(mode)
View
8 resources/lib/qobuz/node/node.py
@@ -305,11 +305,9 @@ def attach_context_menu(self,item):
cmd = "XBMC.Container.Update(%s)" % (self.make_url(Mode.PLAYLIST_ADD_TO_CURRENT))
menuItems.append((qobuz.utils.color(color,qobuz.lang(39005)),cmd))
- #=======================================================================
- # ''' ADD AS NEW '''
- # cmd = "XBMC.Container.Update(%s)" % (self.make_url(Mode.PLAYLIST_ADD_AS_NEW))
- # menuItems.append((qobuz.utils.color(color, "(i8n) Add as new"),cmd))
- #=======================================================================
+ ''' ADD AS NEW '''
+ cmd = "XBMC.Container.Update(%s)" % (self.make_url(Mode.PLAYLIST_ADD_AS_NEW))
+ menuItems.append((qobuz.utils.color(color, "(i8n) Add as new"),cmd))
''' Show playlist '''
if not (self.type & NodeFlag.TYPE_PLAYLIST):
View
4 resources/lib/qobuz/node/playlist.py
@@ -267,8 +267,8 @@ def add_as_new_playlist(self):
dir.end_of_directory()
return False
for node in dir.nodes:
- trackids.append(node.get_id())
- strtracks = ','.join(str(trackids))
+ trackids.append(str(node.get_id()))
+ strtracks = ','.join(trackids)
current_playlist = Cache_current_playlist()
ret = qobuz.api.playlist_add_track(str(current_playlist.get_id()), strtracks)
from utils.cache_manager import cache_manager

0 comments on commit cb262f1

Please sign in to comment.