Wonder if sourceforge's mailing lists were broken? Third try.

Michel Hoogervorst wrote:
> I tried removing /var/cache/freevo/* and indeed there were the album
covers again... for once....
> After returning to a previous played album, the covers are not shown
anymore.
>
> Before I upgraded kaa, I had completely removed the directory
> /usr/lib/python2.4/site-packages/kaa.  Is there another directory which
should be removed?
>
> Michel
>
>>> It should but there is an overlay directory which can be relocated by
configuring it in local_conf.py. The overlay directory has "raw"
format images, including thumbnails of tv shows. Personally I split
the two up the real cache is in /var/cache/freevo and the overlay is
in
>>> /var/lib/freevo.

I've found the bug and am surprised that this worked before.

The attached album-art patch should fix the problem. The cover patch is
contains my debugging messages that were used to track down the problem.

You may not want to update you svn version at the moment, until Adam has
fixed the buttonbar code. The buttonbar plug-in is really quite a nice
feature for people with the coloured button on their remote controls.

Duncan


Index: src/audio/__init__.py
===================================================================
--- src/audio/__init__.py	(revision 9678)
+++ src/audio/__init__.py	(revision 9679)
@@ -42,7 +42,9 @@
 
 
 def cover_filter(x):
-    return re.search(config.AUDIO_COVER_REGEXP, x, re.IGNORECASE)
+    result = re.search(config.AUDIO_COVER_REGEXP, x, re.IGNORECASE)
+    if result: _debug_('cover_filter(%s): %r' % (x, result.group()), 2)
+    return result
 
 
 class PluginInterface(plugin.MimetypePlugin):
@@ -85,6 +87,7 @@
         """
         set information for a diritem based on the content, etc.
         """
+        _debug_('diritem.dir = "%s"' % (diritem.dir), 2)
         if os.path.exists(diritem.dir):
             timestamp = os.stat(diritem.dir)[stat.ST_MTIME]
             if not diritem['coversearch_timestamp'] or \
@@ -101,7 +104,7 @@
                         diritem.image = os.path.join(diritem.dir, covers[0])
                 diritem.store_info('coversearch_timestamp', timestamp)
                 diritem.store_info('coversearch_result', diritem.image)
-            elif not diritem['coversearch_result']:
+            elif diritem['coversearch_result']:
                 diritem.image = diritem['coversearch_result']
 
         if not diritem.info.has_key('title') and diritem.parent:
Index: src/audio/__init__.py
===================================================================
--- src/audio/__init__.py	(revision 9678)
+++ src/audio/__init__.py	(revision 9679)
@@ -42,7 +42,9 @@
 
 
 def cover_filter(x):
-    return re.search(config.AUDIO_COVER_REGEXP, x, re.IGNORECASE)
+    result = re.search(config.AUDIO_COVER_REGEXP, x, re.IGNORECASE)
+    if result: _debug_('cover_filter(%s): %r' % (x, result.group()), 2)
+    return result
 
 
 class PluginInterface(plugin.MimetypePlugin):
@@ -85,6 +87,7 @@
         """
         set information for a diritem based on the content, etc.
         """
+        _debug_('diritem.dir = "%s"' % (diritem.dir), 2)
         if os.path.exists(diritem.dir):
             timestamp = os.stat(diritem.dir)[stat.ST_MTIME]
             if not diritem['coversearch_timestamp'] or \
@@ -101,7 +104,7 @@
                         diritem.image = os.path.join(diritem.dir, covers[0])
                 diritem.store_info('coversearch_timestamp', timestamp)
                 diritem.store_info('coversearch_result', diritem.image)
-            elif not diritem['coversearch_result']:
+            elif diritem['coversearch_result']:
                 diritem.image = diritem['coversearch_result']
 
         if not diritem.info.has_key('title') and diritem.parent:
Index: src/audio/audioitem.py
===================================================================
--- src/audio/audioitem.py	(revision 9678)
+++ src/audio/audioitem.py	(revision 9679)
@@ -80,7 +80,9 @@
             def image_filter(x):
                 return re.match('.*(jpg|png)$', x, re.IGNORECASE)
             def cover_filter(x):
-                return re.search(config.AUDIO_COVER_REGEXP, x, re.IGNORECASE)
+                result = re.search(config.AUDIO_COVER_REGEXP, x, re.IGNORECASE)
+                if result: _debug_('cover_filter(%s): %r' % (x, result.group()), 2)
+                return result
 
             # Pick an image if it is the only image in this dir, or it matches
             # the configurable regexp
Index: src/item.py
===================================================================
--- src/item.py	(revision 9678)
+++ src/item.py	(revision 9679)
@@ -307,17 +307,15 @@
         """
         store the key/value in metadata
         """
-        #if not self.filename:
-        #    return
+        _debug_('key=%s value=%s info-class=%s' % (key, value, self.info.__class__), 2)
+        if hasattr(self, 'filename'): _debug_('filename=%s' % (self.filename), 2)
 
         if isinstance(self.info, mediainfo.Info):
             if not self.info.store(key, value):
                 _debug_('cannot store \'%s\':\'%s\' for \'%s\'' % \
                     (key, value, self.filename), config.DINFO)
-                #print '%s : %s' % (dir(self), type(self))
-                _debug_('%s' % self.__dict__)
         else:
-            _debug_(u'cannot store \'%s\':\'%s\' for \'%s\' item' % \
+            _debug_('cannot store \'%s\':\'%s\' for \'%s\' item, not mediainfo' % \
                 (key, value, self.filename), config.DINFO)
 
 
Index: src/directory.py
===================================================================
--- src/directory.py	(revision 9678)
+++ src/directory.py	(revision 9679)
@@ -99,7 +99,7 @@
     class for handling directories
     """
     def __init__(self, directory, parent, name = '', display_type = None,
-                 add_args = None, create_metainfo=True):
+                 add_args = None, create_metainfo = True):
         self.autovars = [ ('num_dir_items', 0), ('show_all_items', False) ]
         Playlist.__init__(self, parent=parent, display_type=display_type)
         self.type = 'dir'
@@ -173,9 +173,11 @@
         self.modified_vars = []
 
         # Check for a cover in current dir
-        image = util.getimage(os.path.join(directory, 'cover'))
         if self.info['image']:
             image = self.info['image']
+        else:
+            image = util.getimage(os.path.join(directory, 'cover'))
+        # if we have an image then use it
         if image:
             self.image = image
             self.files.image = image
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Freevo-users mailing list
Freevo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freevo-users

Reply via email to