Merge pull request #3845 from ByteHamster/set-file-size-after-download

Set file size after downlaod
This commit is contained in:
H. Lehmann 2020-02-09 13:53:42 +01:00 committed by GitHub
commit d5c6b8a218
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -6,6 +6,7 @@ import android.util.Log;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import java.io.File;
import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutionException;
import de.danoeh.antennapod.core.event.UnreadItemsUpdateEvent; import de.danoeh.antennapod.core.event.UnreadItemsUpdateEvent;
@ -50,6 +51,7 @@ public class MediaDownloadedHandler implements Runnable {
boolean broadcastUnreadStateUpdate = media.getItem() != null && media.getItem().isNew(); boolean broadcastUnreadStateUpdate = media.getItem() != null && media.getItem().isNew();
media.setDownloaded(true); media.setDownloaded(true);
media.setFile_url(request.getDestination()); media.setFile_url(request.getDestination());
media.setSize(new File(request.getDestination()).length());
media.checkEmbeddedPicture(); // enforce check media.checkEmbeddedPicture(); // enforce check
// check if file has chapters // check if file has chapters