[solved] ID3 tag album cover is not displayed (1 Viewer)

horned_reaper

Test Group
  • Team MediaPortal
  • January 7, 2011
    1,233
    461
    Munich
    Home Country
    Germany Germany
    URL = String.Format(MBURL, "release-group", "artist", @"""" + HttpUtility.UrlEncode(artist) + @"""", "AND", "release", @"""" + HttpUtility.UrlEncode(album) + @"""");

    Would this work?
    Code:
    URL = HttpUtility.UrlEncode(String.Format(MBURL, "release-group", "artist", @"""" + artist + @"""", "AND", "release", @"""" + album + @""""));
     

    ajs

    Development Group
  • Team MediaPortal
  • February 29, 2008
    15,492
    10,371
    Kyiv
    Home Country
    Ukraine Ukraine
    I check for %20 and result the some:
    1599037820939.png
     

    horned_reaper

    Test Group
  • Team MediaPortal
  • January 7, 2011
    1,233
    461
    Munich
    Home Country
    Germany Germany
    As you can see in the FH log file, the MBID query is placed with an invalid URL:
    Code:
    01-Sep-2020 18:38:01 Debug [             Scraper]: *** GetMusicBrainzXML: Artist: Various Artists, Album: Dream Dance, Vol. 46, URL: http://www.musicbrainz.org/ws/2/release-group/?query=artist:"Various+Artists" AND release:"Dream+Dance%2c+Vol.+46"

    You can try yourself, the following URL works and returns search results:
    Code:
    http://musicbrainz.org/ws/2/release-group/?query=artist:"Various+Artists"%20AND%20release:%22Dream+Dance%2c+Vol.+46

    FH uses the following URL to resolve MBIDs, which doesn't work, it returns no search results:
    Code:
    http://www.musicbrainz.org/ws/2/release-group/?query=artist:"Various+Artists" AND release:"Dream+Dance%2c+Vol.+46"

    According to the official URL encoding definition space characters in URLs need to be replaced by %20.
    That's why for several albums no album art is downloaded.
    Could you please fix this?
     

    ajs

    Development Group
  • Team MediaPortal
  • February 29, 2008
    15,492
    10,371
    Kyiv
    Home Country
    Ukraine Ukraine
    You can try yourself, the following URL works and returns search results:
    No:
    1599043644447.png
    FH uses the following URL to resolve MBIDs, which doesn't work, it returns no search results:
    The some:
    1599043704010.png
    Look for code:
    1599043832326.png
    No %20 and other URLEncoded chars and correct result ... And all work fine ... Try:
    Code:
    http://musicbrainz.org/ws/2/release-group/?query=artist:"Guns N' Roses" AND release:"Use Your Illusion I"
     

    ajs

    Development Group
  • Team MediaPortal
  • February 29, 2008
    15,492
    10,371
    Kyiv
    Home Country
    Ukraine Ukraine
    characters in URLs need to be replaced by %20
    Or by + sign, but when FH create URI and when WebClient get request for this URI all needed characters changed to correct sign, the some as in browser ... :coffee:
     

    ajs

    Development Group
  • Team MediaPortal
  • February 29, 2008
    15,492
    10,371
    Kyiv
    Home Country
    Ukraine Ukraine
    I create test code for https://repl.it/languages/csharp : Code the some as in FH:
    C#:
    using System;
    using System.Net;
    
    class MainClass {
      public static void Main (string[] args) {
            string DefUserAgent = "Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36";
           
            string artist = "Various+Artists";
            string album = "Dream+Dance%2c+Vol.+46";
            // string artist = "Guns+N'+Roses";
            // string album = "Use+Your+Illusion+I";
            string MBURL     = "http://www.musicbrainz.org/ws/2/{0}/?query={1}:{2} {3} {4}:{5}";
           
            // I remove HttpUtility.UrlEncode because - error CS0103: The name `HttpUtility' does not exist in the current context
            string URL = String.Format(MBURL, "release-group", "artist", @"""" + artist + @"""", "AND", "release", @"""" + album + @"""");
           
            var uri = new Uri(URL);
            WebClient wc = new WebClient();
            wc.Encoding = System.Text.Encoding.UTF8;
            wc.Proxy.Credentials = CredentialCache.DefaultCredentials;
            wc.UseDefaultCredentials = true;
            wc.Headers.Add("User-Agent", DefUserAgent);
            wc.Headers.Add("Content-Type","application/x-www-form-urlencoded");
             
            var servicePoint = ServicePointManager.FindServicePoint(uri);
            servicePoint.Expect100Continue = false;
           
            string xml = wc.DownloadString(uri);
            Console.WriteLine(xml);
      }
    }
    For GNR all work fine, for you album no result ...
     

    Users who are viewing this thread

    Top Bottom