mirror of https://github.com/KDE/kasts.git
Fix enclosure status
Enclosure wasn't checking if file existed on disk. Hence, if the enclosure was reporting a file size of 0 (which matches the non-existent file size, then it would set the status incorrectly to Enclosure::Downloaded.
This commit is contained in:
parent
65c5a16dc8
commit
8c1295372a
|
@ -38,12 +38,14 @@ Enclosure::Enclosure(Entry *entry)
|
|||
m_playposition_dbsave = m_playposition;
|
||||
|
||||
QFile file(path());
|
||||
if (file.exists()) {
|
||||
if(file.size() == m_size) {
|
||||
m_status = Downloaded;
|
||||
} else {
|
||||
if(file.exists()) {
|
||||
file.remove();
|
||||
m_status = Downloadable;
|
||||
}
|
||||
} else {
|
||||
m_status = Downloadable;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue