Commit 5d67f3a5 authored by Marinus Schraal's avatar Marinus Schraal

albumartcache: Improve album name retrieval

For individual songs we were using the songtitle as art lookup trigger,
use the album instead. This fixes albumart missing or incorrectly
showing in the playerbar.
parent e9674fa1
......@@ -220,7 +220,7 @@ class AlbumArtCache(GObject.GObject):
def _lookup_local(self, item, callback, itr, art_size):
"""Checks if there is already a local art file, if not calls
the remote lookup function"""
album = utils.get_media_title(item)
album = utils.get_album_title(item)
artist = utils.get_artist_name(item)
def stream_open(thumb_file, result, arguments):
......@@ -286,7 +286,7 @@ class AlbumArtCache(GObject.GObject):
Lookup remote art through Grilo and if found copy locally. Call
_lookup_local to finish retrieving suitable art.
"""
album = utils.get_media_title(item)
album = utils.get_album_title(item)
artist = utils.get_artist_name(item)
@log
......
......@@ -25,6 +25,25 @@
from gettext import gettext as _
def get_album_title(item):
"""Returns the album title associated with the media item
In case of an audio file the get_album call returns the
album title and in case of a container we are looking for
the title.
:param item: A Grilo Media object
:return: The album title
:rtype: string
"""
album = item.get_album()
if not album:
album = get_media_title(item)
return album
def get_artist_name(item):
"""Returns the preferred artist for a media item.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment