Beispiel #1
0
    def setUp(self):
        for model in (PlaylistTrack, Playlist, User, Album, Artist, Track):
            for obj in model.all():
                obj.delete()

        # some data to work with:
        self.stevie = Artist.create(name="Stevie Wonder")
        self.stevie.put()
        self.talking_book = Album(
            album_id=1,  # faux
            artist=self.stevie,
            title="Talking Book",
            import_timestamp=datetime.datetime.now(),
            num_tracks=10)
        self.talking_book.put()
        self.tracks = {}
        for idx, title in enumerate([
                'You Are The Sunshine Of My Life', 'Maybe Your Baby',
                'You And I (We Can Conquer The World)'
                # ...etc...
        ]):
            track = Track(
                album=self.talking_book,
                title=title,
                sampling_rate_hz=44000,
                bit_rate_kbps=256,
                channels='stereo',
                duration_ms=60 * 60 * 3,  # faux
                track_num=idx + 1)
            self.tracks[title] = track
            track.put()
Beispiel #2
0
def create_stevie_wonder_album_data():
    stevie = Artist.create(name="Stevie Wonder")
    stevie.put()
    talking_book = Album(
        album_id=1,  # faux
        artist=stevie,
        title="Talking Book",
        import_timestamp=datetime.datetime.now(),
        num_tracks=10)
    talking_book.put()
    tracks = {}
    for idx, title in enumerate([
            'You Are The Sunshine Of My Life', 'Maybe Your Baby',
            'You And I (We Can Conquer The World)', 'Tuesday Heartbreak',
            "You've Got It Bad Girl", 'Superstition', 'Big Brother',
            'Blame It On The Sun', "Lookin' For Another Pure Love",
            'I Believe (When I Fall In Love It Will Be Forever)'
    ]):
        track = Track(
            album=talking_book,
            title=title,
            sampling_rate_hz=44000,
            bit_rate_kbps=256,
            channels='stereo',
            duration_ms=60 * 60 * 3,  # faux
            track_num=idx + 1)
        tracks[title] = track
        track.put()

    return stevie, talking_book, tracks