Merge lp:~mims-michael/nuvola-player/albumart-hash-cache into lp:nuvola-player/2.5.x

Proposed by Michael Mims
Status: Superseded
Proposed branch: lp:~mims-michael/nuvola-player/albumart-hash-cache
Merge into: lp:nuvola-player/2.5.x
Diff against target: 13 lines (+1/-2)
1 file modified
src/core/storage.vala (+1/-2)
To merge this branch: bzr merge lp:~mims-michael/nuvola-player/albumart-hash-cache
Reviewer Review Type Date Requested Status
Jiří Janoušek Needs Fixing
Review via email: mp+103158@code.launchpad.net

This proposal supersedes a proposal from 2012-04-23.

This proposal has been superseded by a proposal from 2012-04-23.

Description of the change

Made a change to store album art in cache using the SHA-1 hash of the source URI. Rdio service uses "square-200.jpg" as the name for all album art and thus causes a bug where album art does not update in Nuvola.

To post a comment you must log in.
Revision history for this message
Jiří Janoušek (fenryxo) wrote :

Please use ChecksumType.MD5, it's a lot of faster than SHA1.

review: Needs Fixing
349. By Michael Mims

Changed hash algorithm to MD5 for faster performance.

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/core/storage.vala'
2--- src/core/storage.vala 2012-03-21 22:29:37 +0000
3+++ src/core/storage.vala 2012-04-23 19:29:20 +0000
4@@ -43,8 +43,7 @@
5 public string? get_album_art(string? uri){
6 if(uri == null) return null;
7 /* Album art is stored locally to be passed to libnotify and Sound menu */
8- var i = uri.last_index_of_char('/');
9- var id = uri.substring(i+1);
10+ var id = Checksum.compute_for_string(ChecksumType.SHA1, uri);
11 var f = this.get_default_cache_file(ALBUM_ART_DIRNAME + "/" + id + ".jpg");
12 if(f.query_exists(null)){
13 return f.get_path();

Subscribers

People subscribed via source and target branches