Beispiel #1
0
 def saveButtonHandler(self):
     print("save stuff")
     self.metadataDict["TIT2"] = self.ui.titleLineEdit.text()
     self.metadataDict["TPE1"] = self.ui.artistLineEdit.text()
     self.metadataDict["TALB"] = self.ui.albumLineEdit.text()
     self.metadataDict["TPE2"] = self.ui.albumArtistLineEdit.text()
     self.metadataDict["TCON"] = self.ui.genreLineEdit.text()
     self.metadataDict["TDRC"] = self.ui.yearLineEdit.text()
     # write this to file
     # print("songPath before writing: " + self.songPath)
     manageMetadata = ManageMetaData()
     # print(self.metadataDict)
     # print (self.songPath)
     manageMetadata.WriteMetaData(self.metadataDict, self.songPath)
     print("wrote metadata")
     # update in localStorage
     self.editMetadataDialog.accept()
# D:\\Songs(english)\\naked\\13 Hey There Delilah.mp3
# All Of Me - John Legend.mp3

# For manually testing ManageMetadata module.

from Metadata.ManageMetaDataModule import ManageMetaData

print ("starting test...")
obj=ManageMetaData()
print(obj.titleTIT2)
a=obj.ReadMetaData("D:\\Songs(english)\\naked\\All Of Me - John Legend.mp3")
print(obj.titleTIT2)
print ("printing metadata read:\n")
print(a)
print ("read metadata done")
obj.WriteMetaData(a,"D:/Songs(english)/Imagine Dragons/Imagine dragons-demons.mp3")
print ("write metadata done")

print("lets now see if it has worked!!!\n")
a=obj.ReadMetaData("D:/Songs(english)/Imagine Dragons/Imagine dragons-demons.mp3")
print ("printing metadata read:\n")
print(a)