def test_modified_album_metadata_moved(self): mf = MediaFile(self.i.path) mf.album = 'differentAlbum' mf.save() self._update(move=True) item = self.lib.items().next() self.assertTrue('differentAlbum' in item.path)
def test_modified_album_metadata_art_moved(self): artpath = self.album.artpath mf = MediaFile(self.i.path) mf.album = 'differentAlbum' mf.save() self._update(move=True) album = self.lib.albums()[0] self.assertNotEqual(artpath, album.artpath)
def test_selective_modified_album_metadata_not_moved(self): mf = MediaFile(syspath(self.i.path)) mf.album = u'differentAlbum' mf.genre = u'differentGenre' mf.save() self._update(move=True, fields=['genre']) item = self.lib.items().get() self.assertTrue(b'differentAlbum' not in item.path) self.assertEqual(item.genre, u'differentGenre')
def test_selective_modified_album_metadata_moved(self): mf = MediaFile(syspath(self.i.path)) mf.album = u'differentAlbum' mf.genre = u'differentGenre' mf.save() self._update(move=True, fields=['album']) item = self.lib.items().get() self.assertTrue(b'differentAlbum' in item.path) self.assertNotEqual(item.genre, u'differentGenre')
def test_no_autotag_keeps_duplicate_album(self): config["import"]["autotag"] = False item = self.lib.items().get() self.assertEqual(item.title, u"t\xeftle 0") self.assertTrue(os.path.isfile(item.path)) # Imported item has the same artist and album as the one in the # library. import_file = os.path.join(self.importer.paths[0], "album 0", "track 0.mp3") import_file = MediaFile(import_file) import_file.artist = item["artist"] import_file.albumartist = item["artist"] import_file.album = item["album"] import_file.title = "new title" self.importer.default_resolution = self.importer.Resolution.REMOVE self.importer.run() self.assertTrue(os.path.isfile(item.path)) self.assertEqual(len(self.lib.albums()), 2) self.assertEqual(len(self.lib.items()), 2)
def test_no_autotag_keeps_duplicate_album(self): config['import']['autotag'] = False item = self.lib.items().get() self.assertEqual(item.title, u't\xeftle 0') self.assertTrue(os.path.isfile(item.path)) # Imported item has the same artist and album as the one in the # library. import_file = os.path.join(self.importer.paths[0], 'album 0', 'track 0.mp3') import_file = MediaFile(import_file) import_file.artist = item['artist'] import_file.albumartist = item['artist'] import_file.album = item['album'] import_file.title = 'new title' self.importer.default_resolution = self.importer.Resolution.REMOVE self.importer.run() self.assertTrue(os.path.isfile(item.path)) self.assertEqual(len(self.lib.albums()), 2) self.assertEqual(len(self.lib.items()), 2)