57 QString sql =
"ORDER BY intid";
62 std::vector<VideoMetadataListManager::VideoMetadataPtr> videos(videolist.begin(), videolist.end());
70 nStartIndex = min( nStartIndex, (
int)videos.size() );
71 nCount = (nCount > 0) ? min( nCount, (
int)videos.size() ) : videos.size();
72 int nEndIndex = min((nStartIndex + nCount), (
int)videos.size() );
74 for(
int n = nStartIndex;
n < nEndIndex;
n++ )
84 int curPage = 0, totalPages = 0;
88 totalPages = (
int)ceil((
float)videos.size() / nCount);
94 curPage = (
int)ceil((
float)nStartIndex / nCount) + 1;
97 pVideoMetadataInfos->setStartIndex ( nStartIndex );
98 pVideoMetadataInfos->setCount ( nCount );
99 pVideoMetadataInfos->setCurrentPage ( curPage );
100 pVideoMetadataInfos->setTotalPages ( totalPages );
101 pVideoMetadataInfos->setTotalAvailable( videos.size() );
103 pVideoMetadataInfos->setVersion ( MYTH_BINARY_VERSION );
104 pVideoMetadataInfos->setProtoVer ( MYTH_PROTO_VERSION );
106 return pVideoMetadataInfos;
119 throw( QString(
"No metadata found for selected ID!." ));
125 return pVideoMetadataInfo;
141 throw( QString(
"No metadata found for selected filename!." ));
149 return pVideoMetadataInfo;
157 const QString &Subtitle,
158 const QString &Inetref,
172 Inetref, Season, Episode,
173 GrabberType, AllowGeneric);
176 return pVideoLookups;
178 for(
int n = 0;
n < list.size();
n++ )
186 pVideoLookup->setTitle(lookup->
GetTitle());
188 pVideoLookup->setSeason(lookup->
GetSeason());
189 pVideoLookup->setEpisode(lookup->
GetEpisode());
190 pVideoLookup->setYear(lookup->
GetYear());
191 pVideoLookup->setTagline(lookup->
GetTagline());
194 pVideoLookup->setInetref(lookup->
GetInetref());
197 pVideoLookup->setReleaseDate(
199 QTime(0,0),Qt::LocalTime).toUTC());
201 pVideoLookup->setLength(lookup->
GetRuntime());
205 pVideoLookup->setBudget(lookup->
GetBudget());
206 pVideoLookup->setRevenue(lookup->
GetRevenue());
207 pVideoLookup->setIMDB(lookup->
GetIMDB());
208 pVideoLookup->setTMSRef(lookup->
GetTMSref());
211 ArtworkList::iterator c;
212 for (c = coverartlist.begin(); c != coverartlist.end(); ++c)
215 art->setType(
"coverart");
216 art->setUrl((*c).url);
217 art->setThumbnail((*c).thumbnail);
218 art->setWidth((*c).width);
219 art->setHeight((*c).height);
222 ArtworkList::iterator f;
223 for (f = fanartlist.begin(); f != fanartlist.end(); ++f)
226 art->setType(
"fanart");
227 art->setUrl((*f).url);
228 art->setThumbnail((*f).thumbnail);
229 art->setWidth((*f).width);
230 art->setHeight((*f).height);
233 ArtworkList::iterator
b;
234 for (b = bannerlist.begin(); b != bannerlist.end(); ++
b)
237 art->setType(
"banner");
238 art->setUrl((*b).url);
239 art->setThumbnail((*b).thumbnail);
240 art->setWidth((*b).width);
241 art->setHeight((*b).height);
244 ArtworkList::iterator s;
245 for (s = screenshotlist.begin(); s != screenshotlist.end(); ++s)
248 art->setType(
"screenshot");
249 art->setUrl((*s).url);
250 art->setThumbnail((*s).thumbnail);
251 art->setWidth((*s).width);
252 art->setHeight((*s).height);
259 pVideoLookups->setCount ( list.count() );
261 pVideoLookups->setVersion ( MYTH_BINARY_VERSION );
262 pVideoLookups->setProtoVer ( MYTH_PROTO_VERSION );
266 return pVideoLookups;
275 bool bResult =
false;
284 bResult = metadata->DeleteFromDatabase();
296 const QString &sHostName )
298 if ( sHostName.isEmpty() )
299 throw( QString(
"Host not provided! Local storage is deprecated and "
300 "is not supported by the API." ));
302 if ( sFileName.isEmpty() ||
303 (sFileName.contains(
"/../")) ||
304 (sFileName.startsWith(
"../")) )
306 throw( QString(
"Filename not provided, or fails sanity checks!" ));
311 QString fullname = sgroup.
FindFile(sFileName);
314 throw( QString(
"Provided filename does not exist!" ));
320 LOG(VB_GENERAL, LOG_ERR,
"Video Hash Failed. Unless this is a DVD or "
321 "Blu-ray, something has probably gone wrong.");
355 QString path = sPath;
360 LOG(VB_GENERAL, LOG_NOTICE,
361 QString(
"Parsing Blu-ray at path: %1 ").arg(path));
366 throw( QString(
"Unable to open Blu-ray Metadata Parser!" ));
369 throw( QString(
"Unable to open Blu-ray Disc/Path!" ));
372 throw( QString(
"Unable to parse metadata from Blu-ray Disc/Path!" ));
376 pBlurayInfo->setPath(path);
377 pBlurayInfo->setTitle(bdmeta->
GetTitle());
398 pBlurayInfo->setThumbPath(thumbs.at(0));