Changeset - 08814a44ae4e
[Not reviewed]
default
0 2 0
drewp@bigasterisk.com - 12 years ago 2013-06-16 20:12:46
drewp@bigasterisk.com
emergency fix to playlist, which was getting other non-song junk because of some bnode corruption problem
Ignore-this: c3608bd16c6d5a539e6c96bf737a24ef
2 files changed with 45 insertions and 2 deletions:
0 comments (0 inline, 0 general)
light9/ascoltami/playlist.py
Show inline comments
 
from light9.showconfig import getSongsFromShow, songOnDisk
 
from light9.namespaces import L9
 
from rdflib import URIRef
 

	
 
class NoSuchSong(ValueError):
 
    """Raised when a song is requested that doesn't exist (e.g. one
 
@@ -8,7 +9,28 @@ class NoSuchSong(ValueError):
 
class Playlist(object):
 
    def __init__(self, graph, playlistUri):
 
        self.graph = graph
 
        self.songs = list(graph.items(playlistUri))
 

	
 
        # this should be fixed to share with getSongsFromShow. See note in that one for why I had to stop using graph.items
 
        self.songs = [
 
            URIRef("http://light9.bigasterisk.com/show/dance2013/song1"),
 
            URIRef("http://light9.bigasterisk.com/show/dance2013/song2"),
 
            URIRef("http://light9.bigasterisk.com/show/dance2013/song3"),
 
            URIRef("http://light9.bigasterisk.com/show/dance2013/song4"),
 
            URIRef("http://light9.bigasterisk.com/show/dance2013/song5"),
 
            URIRef("http://light9.bigasterisk.com/show/dance2013/song6"),
 
            URIRef("http://light9.bigasterisk.com/show/dance2013/song7"),
 
            URIRef("http://light9.bigasterisk.com/show/dance2013/song8"),
 
            URIRef("http://light9.bigasterisk.com/show/dance2013/song9"),
 
            URIRef("http://light9.bigasterisk.com/show/dance2013/song10"),
 
            URIRef("http://light9.bigasterisk.com/show/dance2013/song11"),
 
            URIRef("http://light9.bigasterisk.com/show/dance2013/song12"),
 
            URIRef("http://light9.bigasterisk.com/show/dance2013/song13"),
 
            URIRef("http://light9.bigasterisk.com/show/dance2013/song14"),
 
            URIRef("http://light9.bigasterisk.com/show/dance2013/song15"),
 
            URIRef("http://light9.bigasterisk.com/show/dance2013/song16"),
 
            URIRef("http://light9.bigasterisk.com/show/dance2013/song17"),
 
        ]
 
        
 
    def nextSong(self, currentSong):
 
        """Returns the next song in the playlist or raises NoSuchSong if 
 
        we are at the end of the playlist."""
light9/showconfig.py
Show inline comments
 
@@ -74,7 +74,28 @@ def getSongsFromShow(graph, show):
 
    playList = graph.value(show, L9['playList'])
 
    if not playList:
 
        raise ValueError("%r has no l9:playList" % show)
 
    songs = list(graph.items(playList))
 
    songs = [
 
        # this was graph.items(playlistUri) but i was getting other
 
        # items from a totally different list! seems like bnode
 
        # corruption.
 
        URIRef("http://light9.bigasterisk.com/show/dance2013/song1"),
 
        URIRef("http://light9.bigasterisk.com/show/dance2013/song2"),
 
        URIRef("http://light9.bigasterisk.com/show/dance2013/song3"),
 
        URIRef("http://light9.bigasterisk.com/show/dance2013/song4"),
 
        URIRef("http://light9.bigasterisk.com/show/dance2013/song5"),
 
        URIRef("http://light9.bigasterisk.com/show/dance2013/song6"),
 
        URIRef("http://light9.bigasterisk.com/show/dance2013/song7"),
 
        URIRef("http://light9.bigasterisk.com/show/dance2013/song8"),
 
        URIRef("http://light9.bigasterisk.com/show/dance2013/song9"),
 
        URIRef("http://light9.bigasterisk.com/show/dance2013/song10"),
 
        URIRef("http://light9.bigasterisk.com/show/dance2013/song11"),
 
        URIRef("http://light9.bigasterisk.com/show/dance2013/song12"),
 
        URIRef("http://light9.bigasterisk.com/show/dance2013/song13"),
 
        URIRef("http://light9.bigasterisk.com/show/dance2013/song14"),
 
        URIRef("http://light9.bigasterisk.com/show/dance2013/song15"),
 
        URIRef("http://light9.bigasterisk.com/show/dance2013/song16"),
 
        URIRef("http://light9.bigasterisk.com/show/dance2013/song17"),
 
    ]
 

	
 
    return songs
 

	
0 comments (0 inline, 0 general)