-
- All Implemented Interfaces:
public final class DownloadStatus
Download status information corresponding to a media download.
-
-
Field Summary
Fields Modifier and Type Field Description public final static int
PERCENTAGE_UNSET
public final MediaInfo
mediaInfo
public final String
localStorageFolder
public final int
status
public final int
reason
public final String
reasonDescription
public final long
totalSizeBytes
public final long
bytesDownloaded
public final int
downloadPercent
public final String
poster
public final long
lastModifiedTimestamp
public boolean
isSavedOffline
public Date
lastPlayedAt
public final String
displayTitle
public final String
displayDescription
-
Constructor Summary
Constructors Constructor Description DownloadStatus(MediaInfo mediaInfo, String localStorageFolder, int status, int reason, String reasonDescription, long lastModifiedTime, long totalSizeBytes, long bytesDownloaded, int downloadPercent, String posterPath, boolean isSavedOffline, String displayTitle, String displayDescription)
-
Method Summary
Modifier and Type Method Description static DownloadStatus
createForNotFound(@NonNull() MediaInfo mediaInfo)
static DownloadStatus
createForPending(@NonNull() MediaInfo mediaInfo, String localStorageFolder, long lastModifiedTime, long totalSizeBytes, boolean isSavedOffline)
static DownloadStatus
createForRunning(@NonNull() MediaInfo mediaInfo, String localStorageFolder, long lastModifiedTime, long totalSizeBytes, long bytesDownloaded, int downloadPercent, String posterPath, boolean isSavedOffline)
static DownloadStatus
createForPaused(@NonNull() MediaInfo mediaInfo, String localStorageFolder, int reason, long lastModifiedTime, long totalSizeBytes, long bytesDownloaded, int downloadPercent, String posterPath, boolean isSavedOffline)
static DownloadStatus
createForFailed(@NonNull() MediaInfo mediaInfo, String localStorageFolder, int reason, String reasonDescription, long lastModifiedTime, long totalSizeBytes, long bytesDownloaded, int downloadPercent, String posterPath, boolean isSavedOffline)
static DownloadStatus
createForCompleted(@NonNull() MediaInfo mediaInfo, String localStorageFolder, long lastModifiedTime, long totalSizeBytes, long bytesDownloaded, int downloadPercent, String posterPath, boolean isSavedOffline)
static int
getStatus(@Download.State() int state)
static int
getState(int status)
static DownloadStatus
getDownloadStatus(Download download)
Converts Download to DownloadStatus static DownloadStatus
getDownloadStatus(Context context, Download download)
static String
getScrubPreviewUrl(Download download)
synchronized boolean
isExpired(Context context)
static String
getSecurityLevel(Download download)
-
-
Constructor Detail
-
DownloadStatus
DownloadStatus(MediaInfo mediaInfo, String localStorageFolder, int status, int reason, String reasonDescription, long lastModifiedTime, long totalSizeBytes, long bytesDownloaded, int downloadPercent, String posterPath, boolean isSavedOffline, String displayTitle, String displayDescription)
-
-
Method Detail
-
createForNotFound
static DownloadStatus createForNotFound(@NonNull() MediaInfo mediaInfo)
-
createForPending
static DownloadStatus createForPending(@NonNull() MediaInfo mediaInfo, String localStorageFolder, long lastModifiedTime, long totalSizeBytes, boolean isSavedOffline)
-
createForRunning
static DownloadStatus createForRunning(@NonNull() MediaInfo mediaInfo, String localStorageFolder, long lastModifiedTime, long totalSizeBytes, long bytesDownloaded, int downloadPercent, String posterPath, boolean isSavedOffline)
-
createForPaused
static DownloadStatus createForPaused(@NonNull() MediaInfo mediaInfo, String localStorageFolder, int reason, long lastModifiedTime, long totalSizeBytes, long bytesDownloaded, int downloadPercent, String posterPath, boolean isSavedOffline)
-
createForFailed
static DownloadStatus createForFailed(@NonNull() MediaInfo mediaInfo, String localStorageFolder, int reason, String reasonDescription, long lastModifiedTime, long totalSizeBytes, long bytesDownloaded, int downloadPercent, String posterPath, boolean isSavedOffline)
-
createForCompleted
static DownloadStatus createForCompleted(@NonNull() MediaInfo mediaInfo, String localStorageFolder, long lastModifiedTime, long totalSizeBytes, long bytesDownloaded, int downloadPercent, String posterPath, boolean isSavedOffline)
-
getStatus
static int getStatus(@Download.State() int state)
-
getState
static int getState(int status)
-
getDownloadStatus
static DownloadStatus getDownloadStatus(Download download)
Converts Download to DownloadStatus
- Parameters:
download
- Download
-
getDownloadStatus
static DownloadStatus getDownloadStatus(Context context, Download download)
-
getScrubPreviewUrl
static String getScrubPreviewUrl(Download download)
-
getSecurityLevel
static String getSecurityLevel(Download download)
-
-
-
-