if frame is corrupt, delete and try caching again

This commit is contained in:
itsmattkc
2021-09-30 14:14:10 -07:00
parent 5485ea5750
commit 7e884b55e7
3 changed files with 62 additions and 24 deletions
+13 -7
View File
@@ -72,11 +72,21 @@ public:
clear_on_close_ = e;
}
bool DeleteSpecificFile(const QString &f);
signals:
void DeletedFrame(const QString& path, const QByteArray& hash);
private:
QByteArray DeleteLeastRecent();
struct HashTime {
QString file_name;
qint64 file_size;
qint64 access_time;
};
bool DeleteFileInternal(QMap<QByteArray, HashTime>::iterator hash_to_delete);
bool DeleteLeastRecent();
void CloseCacheFolder();
@@ -84,12 +94,6 @@ private:
QString index_path_;
struct HashTime {
QString file_name;
qint64 file_size;
qint64 access_time;
};
QMap<QByteArray, HashTime> disk_data_;
qint64 consumption_;
@@ -149,6 +153,8 @@ public slots:
void CreatedFile(const QString& cache_folder, const QString& file_name, const QByteArray& hash);
void DeleteSpecificFile(const QString &filename);
signals:
void DeletedFrame(const QString& path, const QByteArray& hash);