@@ -36,6 +36,8 @@
37using namespace std;
37using namespace std;
39+const std::string AlbumArtProvider::DEFAULT_ALBUM_ART = "/usr/share/unity/icons/album_missing.png";
39static void on_new_pad (GstElement * /*dec*/, GstPad * pad, GstElement * fakesink) {
41static void on_new_pad (GstElement * /*dec*/, GstPad * pad, GstElement * fakesink) {
40 GstPad *sinkpad;
42 GstPad *sinkpad;
@@ -65,7 +67,7 @@ static void process_one_tag (const GstTagList * list, const gchar * tag, gpointe
68−albuminfo AlbumArtProvider::get_album_info(const std::string &filename) throw (runtime_error)
70+albuminfo AlbumArtProvider::get_album_info(const std::string &filename) throw (runtime_error)
70 albuminfo ai;
72 albuminfo ai;
71 // FIXME: Need to do quoting. Files with %'s in their names seem to confuse gstreamer.
73 // FIXME: Need to do quoting. Files with %'s in their names seem to confuse gstreamer.
@@ -152,6 +154,8 @@ std::string AlbumArtProvider::get_lastfm_url(const albuminfo &ai) {
152 return "";
154 return "";
155 QXmlQuery query;
159 QXmlQuery query;
156 QBuffer tmp;
160 QBuffer tmp;
157 tmp.setData(reply->readAll());
161 tmp.setData(reply->readAll());
@@ -214,10 +218,10 @@ std::string AlbumArtProvider::get_image(const std::string &filename) {
214 info = get_album_info(filename);
218 info = get_album_info(filename);
215 } catch(std::exception &e) {
219 } catch(std::exception &e) {
216 qDebug() << "Could not determine album info: " << e.what();
220 qDebug() << "Could not determine album info: " << e.what();
217− return "";
221+ return DEFAULT_ALBUM_ART;
219 if(info.album.empty() || info.artist.empty()) {
223 if(info.album.empty() || info.artist.empty()) {
220− return "";
224+ return DEFAULT_ALBUM_ART;
222 if(cache.has_art(info.artist, info.album)) {
226 if(cache.has_art(info.artist, info.album)) {
223 // Image may have expired from cache between these two lines.
227 // Image may have expired from cache between these two lines.
@@ -226,7 +230,7 @@ std::string AlbumArtProvider::get_image(const std::string &filename) {
227 std::string image_url = get_lastfm_url(info);
231 std::string image_url = get_lastfm_url(info);
228 if(image_url.empty()) {
232 if(image_url.empty()) {
229− return "";
233+ return DEFAULT_ALBUM_ART;
231 char tmpname[] = "/tmp/path/to/some/file/somewhere/maybe.jpg";
235 char tmpname[] = "/tmp/path/to/some/file/somewhere/maybe.jpg";
232 tmpnam(tmpname);
236 tmpnam(tmpname);