mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-30 17:01:08 +02:00
yt download fixes
Conflicts:
src/gui/moviebrowser.cpp
Origin commit data
------------------
Branch: ni/coolstream
Commit: f6ae1796f2
Author: martii <m4rtii@gmx.de>
Date: 2013-06-13 (Thu, 13 Jun 2013)
------------------
This commit was generated by Migit
This commit is contained in:
@@ -3774,15 +3774,15 @@ int CYTCacheSelectorTarget::exec(CMenuTarget* /*parent*/, const std::string & ac
|
||||
} else if (actionKey == "rc_spkr" && selected >= movieBrowser->yt_completed_offset && selected < movieBrowser->yt_failed_offset) {
|
||||
cYTCache::getInstance()->remove(&movieBrowser->yt_completed[selected - movieBrowser->yt_completed_offset]);
|
||||
} else if (actionKey == "") {
|
||||
if (selected >= movieBrowser->yt_pending_offset && selected < movieBrowser->yt_completed_offset) {
|
||||
if (movieBrowser->yt_pending_offset && selected >= movieBrowser->yt_pending_offset && selected < movieBrowser->yt_completed_offset) {
|
||||
if(ShowMsg (LOCALE_MOVIEBROWSER_YT_CACHE, g_Locale->getText(LOCALE_MOVIEBROWSER_YT_CANCEL_TRANSFER), CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes)
|
||||
cYTCache::getInstance()->cancel(&movieBrowser->yt_pending[selected - movieBrowser->yt_pending_offset]);
|
||||
else
|
||||
return menu_return::RETURN_NONE;
|
||||
} else if (selected >= movieBrowser->yt_completed_offset && selected < movieBrowser->yt_failed_offset) {
|
||||
} else if (movieBrowser->yt_completed_offset && selected >= movieBrowser->yt_completed_offset && selected < movieBrowser->yt_failed_offset) {
|
||||
// FIXME -- anything sensible to do here?
|
||||
return menu_return::RETURN_NONE;
|
||||
} else if (selected >= movieBrowser->yt_failed_offset && selected < movieBrowser->yt_menue->getItemsCount()){
|
||||
} else if (movieBrowser->yt_failed_offset && selected >= movieBrowser->yt_failed_offset && selected < movieBrowser->yt_menue->getItemsCount()){
|
||||
cYTCache::getInstance()->clearFailed(&movieBrowser->yt_failed[selected - movieBrowser->yt_failed_offset]);
|
||||
cYTCache::getInstance()->addToCache(&movieBrowser->yt_failed[selected - movieBrowser->yt_failed_offset]);
|
||||
const char *format = g_Locale->getText(LOCALE_MOVIEBROWSER_YT_CACHE_ADD);
|
||||
@@ -3804,10 +3804,9 @@ void CMovieBrowser::refreshYTMenu()
|
||||
{
|
||||
for (u_int item_id = (u_int) yt_menue->getItemsCount() - 1; item_id > yt_menue_end - 1; item_id--) {
|
||||
CMenuItem* m = yt_menue->getItem(item_id);
|
||||
if (m && !m->isStatic) {
|
||||
if (m && !m->isStatic)
|
||||
delete m;
|
||||
yt_menue->removeItem(item_id);
|
||||
}
|
||||
yt_menue->removeItem(item_id);
|
||||
}
|
||||
yt_pending = cYTCache::getInstance()->getPending();
|
||||
yt_completed = cYTCache::getInstance()->getCompleted();
|
||||
|
@@ -67,14 +67,11 @@ std::string cYTCache::getName(MI_MOVIE_INFO *mi, std::string ext)
|
||||
bool cYTCache::useCachedCopy(MI_MOVIE_INFO *mi)
|
||||
{
|
||||
std::string file = getName(mi);
|
||||
fprintf(stderr, "checking %s\n", file.c_str());
|
||||
if (access(file.c_str(), R_OK))
|
||||
return false;
|
||||
std::string xml = getName(mi, "xml");
|
||||
fprintf(stderr, "checking %s\n", xml.c_str());
|
||||
if (!access(xml.c_str(), R_OK)) {
|
||||
mi->file.Url = file;
|
||||
fprintf(stderr, "using cached copy: %s\n", file.c_str());
|
||||
return true;
|
||||
}
|
||||
{
|
||||
@@ -104,7 +101,7 @@ bool cYTCache::download(MI_MOVIE_INFO *mi)
|
||||
std::string file = getName(mi);
|
||||
std::string xml = getName(mi, "xml");
|
||||
if (!access(file.c_str(), R_OK) && !access(xml.c_str(), R_OK)) {
|
||||
fprintf(stderr, "%s: %s already present an valid\n", __func__, file.c_str());
|
||||
fprintf(stderr, "%s: %s already present and valid\n", __func__, file.c_str());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user