restore extension/filetype detection

This commit is contained in:
Arno Hautala 2021-09-01 12:30:00 -04:00
parent 767f371637
commit a61317df67

View file

@ -394,8 +394,12 @@ class Track(Record):
def populate(self, filename): def populate(self, filename):
self["filename"] = self.path_to_ipod(filename).encode('utf-8') self["filename"] = self.path_to_ipod(filename).encode('utf-8')
if os.path.splitext(filename)[1].lower() in (".m4a", ".m4b", ".m4p", ".aa"): # assign the "filetype" based on the extension
self["filetype"] = 2 ext = os.path.splitext(filename)[1].lower()
for type in FileType:
if ext in type.extensions:
self.filetype = type.filetype
break
if "/iPod_Control/Podcasts/" in filename: if "/iPod_Control/Podcasts/" in filename:
self.set_podcast() self.set_podcast()