Skip to content
This repository
Browse code

Fix add_as_new_playlist bug and reenable the item

  • Loading branch information...
commit cb262f11b6cb167d82756e46f89daa8e0832d593 1 parent 2137230
Cyril Leclerc authored
63 .project
... ... @@ -1,34 +1,29 @@
1   -<?xml version="1.0" encoding="UTF-8"?>
2   -<projectDescription>
3   - <name>plugin.audio.qobuz2</name>
4   - <comment></comment>
5   - <projects>
6   - </projects>
7   - <buildSpec>
8   - <buildCommand>
9   - <name>org.python.pydev.PyDevBuilder</name>
10   - <arguments>
11   - </arguments>
12   - </buildCommand>
13   - <buildCommand>
14   - <name>com.aptana.ide.core.unifiedBuilder</name>
15   - <arguments>
16   - </arguments>
17   - </buildCommand>
18   - </buildSpec>
19   - <natures>
20   - <nature>com.aptana.projects.webnature</nature>
21   - <nature>org.python.pydev.pythonNature</nature>
22   - </natures>
23   - <filteredResources>
24   - <filter>
25   - <id>1331459313201</id>
26   - <name></name>
27   - <type>22</type>
28   - <matcher>
29   - <id>org.eclipse.ui.ide.multiFilter</id>
30   - <arguments>1.0-name-matches-false-true-.*\.py(c|o)</arguments>
31   - </matcher>
32   - </filter>
33   - </filteredResources>
34   -</projectDescription>
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<projectDescription>
  3 + <name>plugin.audio.qobuz2</name>
  4 + <comment></comment>
  5 + <projects>
  6 + </projects>
  7 + <buildSpec>
  8 + <buildCommand>
  9 + <name>org.python.pydev.PyDevBuilder</name>
  10 + <arguments>
  11 + </arguments>
  12 + </buildCommand>
  13 + </buildSpec>
  14 + <natures>
  15 + <nature>com.aptana.projects.webnature</nature>
  16 + <nature>org.python.pydev.pythonNature</nature>
  17 + </natures>
  18 + <filteredResources>
  19 + <filter>
  20 + <id>1331459313201</id>
  21 + <name></name>
  22 + <type>22</type>
  23 + <matcher>
  24 + <id>org.eclipse.ui.ide.multiFilter</id>
  25 + <arguments>1.0-name-matches-false-true-.*\.py(c|o)</arguments>
  26 + </matcher>
  27 + </filter>
  28 + </filteredResources>
  29 +</projectDescription>
24 .pydevproject
... ... @@ -1,12 +1,12 @@
1   -<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2   -<?eclipse-pydev version="1.0"?>
3   -
4   -<pydev_project>
5   -<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
6   -<path>/plugin.audio.qobuzgithub</path>
7   -<path>/plugin.audio.qobuzgithub/resources/lib/qobuz</path>
8   -</pydev_pathproperty>
9   -<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.7</pydev_property>
10   -<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
11   -
12   -</pydev_project>
  1 +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
  2 +<?eclipse-pydev version="1.0"?>
  3 +
  4 +<pydev_project>
  5 +<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
  6 +<path>/plugin.audio.qobuz</path>
  7 +<path>/plugin.audio.qobuz/resources/lib/qobuz</path>
  8 +</pydev_pathproperty>
  9 +<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.7</pydev_property>
  10 +<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
  11 +
  12 +</pydev_project>
16 resources/lib/qobuz/bootstrap.py
@@ -307,15 +307,13 @@ def dispatch(self):
307 307 return False
308 308 return True
309 309
310   - #=======================================================================
311   - # elif self.MODE == Mode.PLAYLIST_ADD_AS_NEW:
312   - # from node.playlist import Node_playlist
313   - # node = Node_playlist(None, self.params)
314   - # if not node.add_as_new_playlist():
315   - # return False
316   - # return True
317   - #=======================================================================
318   -
  310 + elif self.MODE == Mode.PLAYLIST_ADD_AS_NEW:
  311 + from node.playlist import Node_playlist
  312 + node = Node_playlist(None, self.params)
  313 + if not node.add_as_new_playlist():
  314 + return False
  315 + return True
  316 +
319 317 elif self.MODE == Mode.PLAYLIST_RENAME:
320 318 from node.user_playlists import Node_user_playlists
321 319 node = Node_user_playlists()
2  resources/lib/qobuz/constants.py
@@ -46,7 +46,7 @@ def to_s(self, mode):
46 46 elif mode == self.PLAYLIST_REMOVE_TRACK: return "playlist remove track"
47 47 elif mode == self.PLAYLIST_CREATE: return "playlist create"
48 48 elif mode == self.PLAYLIST_RENAME: return "playlist rename"
49   - # elif mode == self.PLAYLIST_ADD_AS_NEW: return "playlist add as new"
  49 + elif mode == self.PLAYLIST_ADD_AS_NEW: return "playlist add as new"
50 50 elif mode == self.PLAYLIST_ADD_TO_CURRENT: return "playlist add to current"
51 51 elif mode == self.PLAYLIST_SELECT_CURRENT: return "playlist select current"
52 52 else: return "Unknow mode: " + str(mode)
8 resources/lib/qobuz/node/node.py
@@ -305,11 +305,9 @@ def attach_context_menu(self,item):
305 305 cmd = "XBMC.Container.Update(%s)" % (self.make_url(Mode.PLAYLIST_ADD_TO_CURRENT))
306 306 menuItems.append((qobuz.utils.color(color,qobuz.lang(39005)),cmd))
307 307
308   - #=======================================================================
309   - # ''' ADD AS NEW '''
310   - # cmd = "XBMC.Container.Update(%s)" % (self.make_url(Mode.PLAYLIST_ADD_AS_NEW))
311   - # menuItems.append((qobuz.utils.color(color, "(i8n) Add as new"),cmd))
312   - #=======================================================================
  308 + ''' ADD AS NEW '''
  309 + cmd = "XBMC.Container.Update(%s)" % (self.make_url(Mode.PLAYLIST_ADD_AS_NEW))
  310 + menuItems.append((qobuz.utils.color(color, "(i8n) Add as new"),cmd))
313 311
314 312 ''' Show playlist '''
315 313 if not (self.type & NodeFlag.TYPE_PLAYLIST):
4 resources/lib/qobuz/node/playlist.py
@@ -267,8 +267,8 @@ def add_as_new_playlist(self):
267 267 dir.end_of_directory()
268 268 return False
269 269 for node in dir.nodes:
270   - trackids.append(node.get_id())
271   - strtracks = ','.join(str(trackids))
  270 + trackids.append(str(node.get_id()))
  271 + strtracks = ','.join(trackids)
272 272 current_playlist = Cache_current_playlist()
273 273 ret = qobuz.api.playlist_add_track(str(current_playlist.get_id()), strtracks)
274 274 from utils.cache_manager import cache_manager

0 comments on commit cb262f1

Please sign in to comment.
Something went wrong with that request. Please try again.