Linux Problem with album scraper
#1
Music 
Hi to all. =)
First I want sorry for my pure English.
So, I'm now working to make own service for scraping music information and it almost finished. Information about artist it getting right, but with album information there is one problem. I turn on debug in xbmc and see in log this string:
Creating album thumb from memory: special://masterprofile/Thumbnails/Music/7/7b68f214.tbn

The problem is that album scraper create thumb for each album with that name. So when I open Music->Artist, I see the same thumb for all albums. BUT when I open "Album information" in log appear something like that:
FileCurl::Open(0xbfc025c0) http://192.168.66.61/handler/covers/albu...8/mega.png
INFO: Creating album thumb from memory: special://masterprofile/Thumbnails/Music/1/191dd95d.tbn

After that cover of album shown and is correct. My question is: why scraper downloads all album thumbs in one file (7b68f214.tbn) and how to fix this?
Thanks.
Reply
#2
In 2 days learning problem I see, that all time only album cover download to 7b68f214.tbn, no matter what name, artist, album or path to file; no matter ip address of server, client or domain; I install another virtual machine with Ubuntu and XBMC; I compile XBMC from source but all time all albums covers download to the same file 7b68f214.tbn. What that means? Thanks.
Reply
#3
I try to paste my LOG messages is source code XBMC to see in what problem is and find that:

17:09:05 T:2941254512 DEBUG: CThumbnailCache, GetMusicThumb thumb 3: unknown
17:09:05 T:2941254512 DEBUG: CThumbnailCache, GetMusicThumb thumb 3: 7/7b68f214.tbn

So in some reason scraper XBMC think that all albums name is unknown, get link to picture from my server and paste it to file 7b68f214.tbn (CRC + Hex from "unknown"). Why he think that - it is magic...
Reply
#4
I find where variables "artist" and "album" become empty and find this out in this block in /xbmc/music/infoscanner/MusicInfoScanner.cpp:

while (!scraper.Completed())
{
if (m_bStop)
{
bCanceled = true;
scraper.Cancel();
}
Sleep(1);
}

I insert CLog::Log(LOGDEBUG, ...) before and after. Before - variables album and artist exist, after him - empty. So I made small changes in source code (in attachment file), compile, make package, install and scan files one more time and was very happy, because all now works Smile

But it is not good idea to change source code to work with my scraper. So in that problemHuh Why XBMC scraper doesn't work normally with my scraper?

Code:
--- xbmc-11.0~git20120321.14feb09.orig/xbmc/music/infoscanner/MusicInfoScanner.cpp
+++ xbmc-11.0~git20120321.14feb09/xbmc/music/infoscanner/MusicInfoScanner.cpp
@@ -842,7 +842,7 @@ bool CMusicInfoScanner::DownloadAlbumInf
       CAlbum album;
       nfoReader.GetDetails(album);
       m_musicDatabase.SetAlbumInfo(params.GetAlbumId(), album, album.songs);
-      GetAlbumArtwork(params.GetAlbumId(), album);
+      GetAlbumArtwork(params.GetAlbumId(), album.strAlbum, album.strArtist, album);
       m_musicDatabase.Close();
       return true;
     }
@@ -981,6 +981,10 @@ bool CMusicInfoScanner::DownloadAlbumInf
       return false;
     }
   }
+  
+  CMusicAlbumInfo& tempInfo = scraper.GetAlbum(iSelectedAlbum);
+  CStdString strAlbumName = tempInfo.GetAlbum().strAlbum;
+  CStdString strArtistName = tempInfo.GetAlbum().strArtist;

   scraper.LoadAlbumInfo(iSelectedAlbum);
   while (!scraper.Completed())
@@ -995,7 +999,6 @@ bool CMusicInfoScanner::DownloadAlbumInf

   if (scraper.Succeeded())
   {
-    albumInfo = scraper.GetAlbum(iSelectedAlbum);
     album = scraper.GetAlbum(iSelectedAlbum).GetAlbum();
     if (result == CNfoFile::COMBINED_NFO)
       nfoReader.GetDetails(album,NULL,true);
@@ -1008,19 +1011,19 @@ bool CMusicInfoScanner::DownloadAlbumInf
   }

   // check thumb stuff
-  GetAlbumArtwork(params.GetAlbumId(), album);
+  GetAlbumArtwork(params.GetAlbumId(), strAlbumName, strArtistName, album);
   m_musicDatabase.Close();
   return true;
}

-void CMusicInfoScanner::GetAlbumArtwork(long id, const CAlbum &album)
+void CMusicInfoScanner::GetAlbumArtwork(long id, const CStdString &albumName, const CStdString &artistName, const CAlbum &album)
{
   if (album.thumbURL.m_url.size())
   {
     CStdString thumb;
     if (!m_musicDatabase.GetAlbumThumb(id, thumb) || thumb.IsEmpty() || !XFILE::CFile::Exists(thumb))
     {
-      thumb = CThumbnailCache::GetAlbumThumb(album);
+      thumb = CThumbnailCache::GetAlbumThumb(albumName,artistName);
       CScraperUrl::DownloadThumbnail(thumb,album.thumbURL.m_url[0]);
       m_musicDatabase.SaveAlbumThumb(id, thumb);
     }
--- xbmc-11.0~git20120321.14feb09.orig/xbmc/music/infoscanner/MusicInfoScanner.h
+++ xbmc-11.0~git20120321.14feb09/xbmc/music/infoscanner/MusicInfoScanner.h
@@ -64,7 +64,7 @@ protected:
   int RetrieveMusicInfo(CFileItemList& items, const CStdString& strDirectory);
   void UpdateFolderThumb(const VECSONGS &songs, const CStdString &folderPath);
   int GetPathHash(const CFileItemList &items, CStdString &hash);
-  void GetAlbumArtwork(long id, const CAlbum &artist);
+  void GetAlbumArtwork(long id, const CStdString &albumName, const CStdString &artistName, const CAlbum &album);
   void GetArtistArtwork(long id, const CStdString &artistName, const CArtist *artist = NULL);

   bool DoScan(const CStdString& strDirectory);
Reply

Logout Mark Read Team Forum Stats Members Help
Problem with album scraper0