Permalink
Browse files

Loaders: Depriorize disc streaming queue items.

We want the local items, if any, to load first.  This gives us icons, etc.
  • Loading branch information...
unknownbrackets committed Dec 10, 2017
1 parent 2943bbd commit 8b665ae6962ab45160393337c33fba0c9c2e54c9
@@ -289,6 +289,10 @@ void CachingFileLoader::StartReadAhead(s64 pos) {
th.detach();
}
bool CachingFileLoader::IsRemote() {
return backend_->IsRemote();
}
void CachingFileLoader::Cancel() {
backend_->Cancel();
}
@@ -28,6 +28,7 @@ class CachingFileLoader : public FileLoader {
CachingFileLoader(FileLoader *backend);
~CachingFileLoader() override;
bool IsRemote() override;
bool Exists() override;
bool ExistsFast() override;
bool IsDirectory() override;
@@ -115,6 +115,10 @@ size_t DiskCachingFileLoader::ReadAt(s64 absolutePos, size_t bytes, void *data,
return readSize;
}
bool DiskCachingFileLoader::IsRemote() {
return backend_->IsRemote();
}
void DiskCachingFileLoader::Cancel() {
backend_->Cancel();
}
@@ -32,6 +32,7 @@ class DiskCachingFileLoader : public FileLoader {
DiskCachingFileLoader(FileLoader *backend);
~DiskCachingFileLoader() override;
bool IsRemote() override;
bool Exists() override;
bool ExistsFast() override;
bool IsDirectory() override;
@@ -30,6 +30,9 @@ class HTTPFileLoader : public FileLoader {
HTTPFileLoader(const std::string &filename);
virtual ~HTTPFileLoader() override;
bool IsRemote() override {
return true;
}
virtual bool Exists() override;
virtual bool ExistsFast() override;
virtual bool IsDirectory() override;
@@ -270,3 +270,7 @@ u32 RamCachingFileLoader::NextAheadBlock() {
return 0xFFFFFFFF;
}
bool RamCachingFileLoader::IsRemote() {
return backend_->IsRemote();
}
@@ -28,6 +28,7 @@ class RamCachingFileLoader : public FileLoader {
RamCachingFileLoader(FileLoader *backend);
~RamCachingFileLoader() override;
bool IsRemote() override;
bool Exists() override;
bool ExistsFast() override;
bool IsDirectory() override;
@@ -73,6 +73,10 @@ size_t RetryingFileLoader::ReadAt(s64 absolutePos, size_t bytes, void *data, Fla
return readSize;
}
bool RetryingFileLoader::IsRemote() {
return backend_->IsRemote();
}
void RetryingFileLoader::Cancel() {
backend_->Cancel();
}
@@ -25,6 +25,7 @@ class RetryingFileLoader : public FileLoader {
RetryingFileLoader(FileLoader *backend);
~RetryingFileLoader() override;
bool IsRemote() override;
bool Exists() override;
bool ExistsFast() override;
bool IsDirectory() override;
@@ -66,6 +66,9 @@ class FileLoader {
virtual ~FileLoader() {}
virtual bool IsRemote() {
return false;
}
virtual bool Exists() = 0;
virtual bool ExistsFast() {
return Exists();
@@ -650,6 +650,11 @@ class GameInfoWorkItem : public PrioritizedWorkQueueItem {
}
float priority() override {
auto fl = info_->GetFileLoader();
if (fl && fl->IsRemote()) {
// Increase the value so remote info loads after non-remote.
return info_->lastAccessedTime + 1000.0f;
}
return info_->lastAccessedTime;
}

0 comments on commit 8b665ae

Please sign in to comment.