2 * Copyright (C) 2005-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
11 #include "MusicAlbumInfo.h"
12 #include "MusicArtistInfo.h"
13 #include "addons/Scraper.h"
14 #include "threads/Thread.h"
23 namespace MUSIC_GRABBER
25 class CMusicInfoScraper
: public CThread
28 explicit CMusicInfoScraper(const ADDON::ScraperPtr
&scraper
);
29 ~CMusicInfoScraper(void) override
;
30 void FindAlbumInfo(const std::string
& strAlbum
, const std::string
& strArtist
= "");
31 void LoadAlbumInfo(int iAlbum
);
32 void FindArtistInfo(const std::string
& strArtist
);
33 void LoadArtistInfo(int iArtist
, const std::string
&strSearch
);
38 int GetAlbumCount() const;
39 int GetArtistCount() const;
40 CMusicAlbumInfo
& GetAlbum(int iAlbum
);
41 CMusicArtistInfo
& GetArtist(int iArtist
);
42 std::vector
<CMusicArtistInfo
>& GetArtists()
46 std::vector
<CMusicAlbumInfo
>& GetAlbums()
50 void SetScraperInfo(const ADDON::ScraperPtr
& scraper
)
55 \brief Checks whether we have a valid scraper. If not, we try the fallbackScraper
56 First tests the current scraper for validity by loading it. If it is not valid we
57 attempt to load the fallback scraper. If this is also invalid we return false.
58 \param fallbackScraper name of scraper to use as a fallback
59 \return true if we have a valid scraper (or the default is valid).
61 bool CheckValidOrFallback(const std::string
&fallbackScraper
);
65 void FindArtistInfo();
66 void LoadArtistInfo();
67 void OnStartup() override
;
68 void Process() override
;
69 std::vector
<CMusicAlbumInfo
> m_vecAlbums
;
70 std::vector
<CMusicArtistInfo
> m_vecArtists
;
71 std::string m_strAlbum
;
72 std::string m_strArtist
;
73 std::string m_strSearch
;
78 XFILE::CCurlFile
* m_http
;
79 ADDON::ScraperPtr m_scraper
;