mirror of
https://github.com/nims11/IPod-Shuffle-4g.git
synced 2025-12-08 00:18:01 +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):
|
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()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue