mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 09:53:33 +00:00
WIP - Multiple MediaSourceFactory
This commit is contained in:
parent
72218749c0
commit
b30e2651f8
2 changed files with 15 additions and 22 deletions
|
|
@ -39,7 +39,7 @@ public final class DownloadUtil {
|
|||
private static DownloadTracker downloadTracker;
|
||||
private static DownloadNotificationHelper downloadNotificationHelper;
|
||||
|
||||
public static synchronized HttpDataSource.Factory getHttpDataSourceFactory(Context context) {
|
||||
public static synchronized HttpDataSource.Factory getHttpDataSourceFactory() {
|
||||
if (httpDataSourceFactory == null) {
|
||||
CookieManager cookieManager = new CookieManager();
|
||||
cookieManager.setCookiePolicy(CookiePolicy.ACCEPT_ORIGINAL_SERVER);
|
||||
|
|
@ -71,6 +71,7 @@ public final class DownloadUtil {
|
|||
File downloadContentDirectory = new File(getDownloadDirectory(context), DOWNLOAD_CONTENT_DIRECTORY);
|
||||
downloadCache = new SimpleCache(downloadContentDirectory, new NoOpCacheEvictor(), getDatabaseProvider(context));
|
||||
}
|
||||
|
||||
return downloadCache;
|
||||
}
|
||||
|
||||
|
|
@ -79,8 +80,8 @@ public final class DownloadUtil {
|
|||
DefaultDownloadIndex downloadIndex = new DefaultDownloadIndex(getDatabaseProvider(context));
|
||||
upgradeActionFile(context, DOWNLOAD_ACTION_FILE, downloadIndex, false);
|
||||
upgradeActionFile(context, DOWNLOAD_TRACKER_ACTION_FILE, downloadIndex, true);
|
||||
downloadManager = new DownloadManager(context, getDatabaseProvider(context), getDownloadCache(context), getHttpDataSourceFactory(context), Executors.newFixedThreadPool(6));
|
||||
downloadTracker = new DownloadTracker(context, getHttpDataSourceFactory(context), downloadManager);
|
||||
downloadManager = new DownloadManager(context, getDatabaseProvider(context), getDownloadCache(context), getHttpDataSourceFactory(), Executors.newFixedThreadPool(6));
|
||||
downloadTracker = new DownloadTracker(context, getHttpDataSourceFactory(), downloadManager);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue