Beispiel #1
0
    def test_flush_changes_album(self, album):
        path = album.path
        artist = u'Foo'
        controller.retag_album(album, {'artist': artist})
        controller.flush_changes(album)

        changed_album = controller.build_albums(path).next()
        assert changed_album.artist == artist
Beispiel #2
0
    def test_retag_album(self, album):
        tags = {'artist': 'NewArtist', 'album': 'NewAlbum',
                'date': '2013', 'genre': 'NewGenre'}

        controller.retag_album(album, tags)

        for name, tag in tags.items():
            assert getattr(album, name) == tag

            for track in album:
                assert getattr(track, name) == tag
Beispiel #3
0
    def confirmChanges(self):
        tags = {}
        for field, lineEdit in self.tagsToAttribs.items():
            tag = lineEdit.text()
            tags[field] = tag

        view = self.albumView

        for album in view.selectedAlbums():
            controller.retag_album(album, tags)

        for track in view.selectedTracks():
            controller.retag_track(track, tags)

        self.saveChanges()