mirror of
https://github.com/nims11/IPod-Shuffle-4g.git
synced 2025-12-07 16:08:00 +09:00
restore extension/filetype detection
This commit is contained in:
parent
767f371637
commit
a61317df67
1 changed files with 6 additions and 2 deletions
|
|
@ -394,8 +394,12 @@ class Track(Record):
|
|||
def populate(self, filename):
|
||||
self["filename"] = self.path_to_ipod(filename).encode('utf-8')
|
||||
|
||||
if os.path.splitext(filename)[1].lower() in (".m4a", ".m4b", ".m4p", ".aa"):
|
||||
self["filetype"] = 2
|
||||
# assign the "filetype" based on the extension
|
||||
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:
|
||||
self.set_podcast()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue