This was a problem on my Blackberry which creates a BBthumbs.dat file in all
the podcast folders. I'm not sure this patch deals with it in the right way
but I thought I'd give it a shot.
Since other devices may create other file types, it may be best to include
only audio/video files instead of trying to guess what files may need to be
excluded.
-Bill
From ef434faef24387c26bb93a19da5588ccbbe6aa5d Mon Sep 17 00:00:00 2001
From: Bill Peters <bill...@dell-dog.(none)>
Date: Sun, 28 Jun 2009 22:20:29 -0400
Subject: [PATCH] Changes made to exclude *.dat files from the edit device playlist util.
I did this because my Blackberry mp3 device creates a BBThumbs.dat file
in every podcast folder. Not sure if this is the best way to solve it but
it does the job for me.
---
src/gpodder/gui.py | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/gpodder/gui.py b/src/gpodder/gui.py
index 3712f72..8cd7df8 100644
--- a/src/gpodder/gui.py
+++ b/src/gpodder/gui.py
@@ -30,6 +30,7 @@ import time
import urllib
import urllib2
import datetime
+import fnmatch
from xml.sax import saxutils
@@ -4940,10 +4941,11 @@ class gPodderPlaylist(BuilderWidget):
for file in files:
filename = os.path.join(root, file)
- if filename == self.playlist_file:
+ if filename == self.playlist_file or fnmatch.fnmatch(filename, '*.dat') or fnmatch.fnmatch(filename, '*.DAT'):
# We don't want to have our playlist file as
# an entry in our file list, so skip it!
- break
+ # We also don't want to include dat files
+ continue
if gl.config.mp3_player_playlist_absolute_path:
filename = filename[len(self.mountpoint):]
--
1.6.0.4
_______________________________________________
gpodder-devel mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/gpodder-devel