cli icon indicating copy to clipboard operation
cli copied to clipboard

Low quality covers, maybe solving it using an album artwork site like fanart.tv?

Open ArthAttack opened this issue 5 years ago • 10 comments

📝Blurry covers on the desktop app

Would be nice if it had a kind of extension to pick up the covers from an external website, cause there's a problem that has be going for months since the last desktop app redesign that are unsolved until now, that the cover is so blurry that it hurts. Spotify image 1 Apple Music image (song imported via Local Files) 2


If you'd like to see this feature implemented, add a 👍 reaction to this post.

ArthAttack avatar Sep 30 '21 17:09 ArthAttack

Looks to me like a fair extension, will be looking forward to your PR @ArthRMH 👀

Right now we have our hands tied down with issues caused by Spotify.

afonsojramos avatar Sep 30 '21 22:09 afonsojramos

Didn't someone in the discord write an extension like this?

theRealPadster avatar Oct 02 '21 00:10 theRealPadster

📝Blurry covers on the desktop app

Would be nice if it had a kind of extension to pick up the covers from an external website, cause there's a problem that has be going for months since the last desktop app redesign that are unsolved until now, that the cover is so blurry that it hurts. Spotify image 1 Apple Music image (song imported via Local Files) 2

If you'd like to see this feature implemented, add a 👍 reaction to this post.

I have a widget that takes album cover from apple music called big sur (amazing widget) but the cover sometimes either is not the same with spotify or its a completely different cover or just blank. (I could get the wrong idea but lmk if I do)

brenmadeit avatar Oct 06 '21 00:10 brenmadeit

This is the extension posted on discord. https://discord.com/channels/842219447716151306/842819014941212682/884895638893002822 I believe it's functional, you just need the PHP file hosted somewhere.

theRealPadster avatar Oct 06 '21 03:10 theRealPadster

do you have the download link? @theRealPadster

ArthAttack avatar Oct 06 '21 16:10 ArthAttack

Found that: https://github.com/PouleR/apple-music-api I guess your are searching for an apple music api.php file

TheGeeKing avatar Oct 06 '21 17:10 TheGeeKing

Found that: https://github.com/PouleR/apple-music-api I guess your are searching for an apple music api.php file

That's just and API Wrapper

afonsojramos avatar Oct 07 '21 13:10 afonsojramos

The discord post just has it embedded in it, no link.

With the comment:

I haven't cleaned this up really, but here's the code as it is. I'll upload it somewhere at some point. Please note, you need to host api.php (https://puu.sh/I9HxC/00f6d66dc6.php) somewhere yourself.

(function HighRes() {
    //Made by @dubu#2080
    var script = document.createElement('script');
    script.src = 'https://code.jquery.com/jquery-3.4.1.min.js';
    script.type = 'text/javascript';
    document.getElementsByTagName('head')[0].appendChild(script);
    
    function performSearch(artist, album) {

    var pathToAPI = 'YOU MUST REPLACE THIS TO USE THIS WITH SPICETIFY'; // replace with your path to the api.php file
    var query = artist + ' ' + album;
    if (!query.length) {
        return false;
    };

    var entity = 'album';
    var country = 'us';
    
    $.ajax({
        type: "GET",
        crossDomain: true,
        url: 'https://itunesartwork.bendodson.com/api.php',
        data: {query: query, entity: entity, country: country, type: 'request'},
        dataType: 'json'
    }).done(function(data) {

        $.ajax({

            type: "GET",
            crossDomain: true,
            url: data.url,
            data: {},
            dataType: 'jsonp'

        }).done(function(data) {

            console.log(data);

            $.ajax({

                type: "POST",
                crossDomain: true,
                url: pathToAPI,
                data: {json: JSON.stringify(data), type: 'data', entity: entity},
                dataType: 'json'

            }).done(function(data) {

                
                if (data.error) {
                        
                } else {
                    if (!data.length) {
                        
                    } else {
                        for (var i = 0; i < data.length; i++) {
                            var result = data[i];
                            console.log("search found " + result.hires);
                            var html = result.hires;
                            
                            if (html.includes("mzstatic")) {
                                newsrc = html;
                                newsrc = newsrc.substring(0, 10) + "-ssl" + newsrc.substring(10, newsrc.length);
                                newsrc = newsrc.substring(0, 4) + "s" + newsrc.substring(4, newsrc.length);
                            }
        
                            albumart = document.querySelector(".cover-art-image");
                            albumart.src = newsrc; 
                            console.log("set higher res");
                            
                            return html;
                            
                        };
                    }
                }

            });
        });
    });
}
    
    Spicetify.Player.addEventListener("songchange", () => {
        const data = Spicetify.Player.data || Spicetify.Queue;
        if (!data) return;
        
        
        const metadata = data.track.metadata;
        console.log(metadata);
        setTimeout(() => {  
        newsrc = metadata.image_xlarge_url;
        
        albumart = document.querySelector(".cover-art-image");
        albumart.src = newsrc; 
        console.log("set highres"); }, 50);
        
        setTimeout(() => {  
        performSearch(metadata.album_artist_name, metadata.album_title);
        
        }, 100);
        
        var r = document.querySelector(':root');
        r.style.setProperty('--nav-bar-width', '800px');
        
    });

})();

theRealPadster avatar Oct 07 '21 17:10 theRealPadster

@theRealPadster I really think we could do this without resorting to a PHP library.

afonsojramos avatar Oct 07 '21 17:10 afonsojramos

Oh yeah we probably can. I was just posting that since I remember seeing someone asking about this exact feature in discord, and someone wrote an extension. I'm sure you can do it without jQuery as well.

theRealPadster avatar Oct 10 '21 18:10 theRealPadster