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;
|
m_playposition_dbsave = m_playposition;
|
||||||
|
|
||||||
QFile file(path());
|
QFile file(path());
|
||||||
if(file.size() == m_size) {
|
if (file.exists()) {
|
||||||
m_status = Downloaded;
|
if(file.size() == m_size) {
|
||||||
} else {
|
m_status = Downloaded;
|
||||||
if(file.exists()) {
|
} else {
|
||||||
file.remove();
|
file.remove();
|
||||||
|
m_status = Downloadable;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
m_status = Downloadable;
|
m_status = Downloadable;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue