diff options
author | H. Lehmann <ByteHamster@users.noreply.github.com> | 2018-05-21 08:14:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-21 08:14:45 +0200 |
commit | 04a635307d80a11e82244232796828ebc5d531ed (patch) | |
tree | 288488c764fd6e32850f259c99183e77905b3706 | |
parent | 03b20790870731c6b797fd494339d4f33288f75a (diff) | |
parent | 6bda6405b8102a1111e6d0521584fedf8ebc3a07 (diff) | |
download | AntennaPod-04a635307d80a11e82244232796828ebc5d531ed.zip |
Merge pull request #2706 from brad/unnecessary-param-context
avoid unused context parameter
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/storage/DownloadRequester.java | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/DownloadRequester.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DownloadRequester.java index a8fd79fda..1f429d189 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/DownloadRequester.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/DownloadRequester.java @@ -176,8 +176,8 @@ public class DownloadRequester { args.putInt(REQUEST_ARG_PAGE_NR, feed.getPageNr()); args.putBoolean(REQUEST_ARG_LOAD_ALL_PAGES, loadAllPages); - download(context, feed, null, new File(getFeedfilePath(context), - getFeedfileName(feed)), true, username, password, lastModified, true, args); + download(context, feed, null, new File(getFeedfilePath(), getFeedfileName(feed)), + true, username, password, lastModified, true, args); } } @@ -203,8 +203,7 @@ public class DownloadRequester { if (feedmedia.getFile_url() != null) { dest = new File(feedmedia.getFile_url()); } else { - dest = new File(getMediafilePath(context, feedmedia), - getMediafilename(feedmedia)); + dest = new File(getMediafilePath(feedmedia), getMediafilename(feedmedia)); } download(context, feedmedia, feed, dest, false, username, password, null, false, null); @@ -305,10 +304,8 @@ public class DownloadRequester { return downloads.size(); } - private synchronized String getFeedfilePath(Context context) - throws DownloadRequestException { - return getExternalFilesDirOrThrowException(context, FEED_DOWNLOADPATH) - .toString() + "/"; + private synchronized String getFeedfilePath() throws DownloadRequestException { + return getExternalFilesDirOrThrowException(FEED_DOWNLOADPATH).toString() + "/"; } private synchronized String getFeedfileName(Feed feed) { @@ -319,10 +316,8 @@ public class DownloadRequester { return "feed-" + FileNameGenerator.generateFileName(filename); } - private synchronized String getMediafilePath(Context context, FeedMedia media) - throws DownloadRequestException { + private synchronized String getMediafilePath(FeedMedia media) throws DownloadRequestException { File externalStorage = getExternalFilesDirOrThrowException( - context, MEDIA_DOWNLOADPATH + FileNameGenerator.generateFileName(media.getItem() .getFeed().getTitle()) + "/" @@ -330,8 +325,7 @@ public class DownloadRequester { return externalStorage.toString(); } - private File getExternalFilesDirOrThrowException(Context context, - String type) throws DownloadRequestException { + private File getExternalFilesDirOrThrowException(String type) throws DownloadRequestException { File result = UserPreferences.getDataFolder(type); if (result == null) { throw new DownloadRequestException( |