diff --git a/Kuroba/app/src/main/java/com/github/adamantcheese/chan/core/saver/ImageSaveTask.java b/Kuroba/app/src/main/java/com/github/adamantcheese/chan/core/saver/ImageSaveTask.java index 2b49c69574..53e099b495 100644 --- a/Kuroba/app/src/main/java/com/github/adamantcheese/chan/core/saver/ImageSaveTask.java +++ b/Kuroba/app/src/main/java/com/github/adamantcheese/chan/core/saver/ImageSaveTask.java @@ -48,7 +48,6 @@ import static com.github.adamantcheese.chan.core.saver.ImageSaver.BundledDownloadResult.Success; import static com.github.adamantcheese.chan.utils.AndroidUtils.getAppContext; import static com.github.adamantcheese.chan.utils.AndroidUtils.openIntent; -import static com.github.adamantcheese.chan.utils.BackgroundUtils.runOnMainThread; public class ImageSaveTask extends FileCacheListener { @@ -111,6 +110,7 @@ public boolean getShare() { public Single run() { BackgroundUtils.ensureBackgroundThread(); + Logger.d(TAG, "ImageSaveTask.run() destination = " + destination.getFullPath()); @Nullable Action onDisposeFunc = null; diff --git a/Kuroba/app/src/main/java/com/github/adamantcheese/chan/ui/controller/AlbumDownloadController.java b/Kuroba/app/src/main/java/com/github/adamantcheese/chan/ui/controller/AlbumDownloadController.java index a50c0e78a4..34dee82718 100644 --- a/Kuroba/app/src/main/java/com/github/adamantcheese/chan/ui/controller/AlbumDownloadController.java +++ b/Kuroba/app/src/main/java/com/github/adamantcheese/chan/ui/controller/AlbumDownloadController.java @@ -128,9 +128,10 @@ public void onClick(View v) { if (checkCount == 0) { showToast(context, R.string.album_download_none_checked); } else { + String siteNameSafe = StringUtils.dirNameRemoveBadCharacters(loadable.site.name()); String subFolder = ChanSettings.saveBoardFolder.get() ? (ChanSettings.saveThreadFolder.get() - ? appendAdditionalSubDirectories(items.get(0).postImage) - : loadable.site.name() + File.separator + loadable.boardCode) : null; + ? appendAdditionalSubDirectories() + : siteNameSafe + File.separator + loadable.boardCode) : null; String message = getString( R.string.album_download_confirm, getQuantityString(R.plurals.image, checkCount, checkCount), @@ -246,7 +247,7 @@ private int getCheckCount() { //This method and the one in ImageViewerController should be roughly equivalent in function @NonNull - private String appendAdditionalSubDirectories(PostImage postImage) { + private String appendAdditionalSubDirectories() { // save to op no appended with the first 50 characters of the subject // should be unique and perfectly understandable title wise String sanitizedSubFolderName = StringUtils.dirNameRemoveBadCharacters(loadable.site.name()) + File.separator diff --git a/Kuroba/app/src/main/java/com/github/adamantcheese/chan/ui/controller/ImageViewerController.java b/Kuroba/app/src/main/java/com/github/adamantcheese/chan/ui/controller/ImageViewerController.java index f6eba658d3..775f7d13b4 100644 --- a/Kuroba/app/src/main/java/com/github/adamantcheese/chan/ui/controller/ImageViewerController.java +++ b/Kuroba/app/src/main/java/com/github/adamantcheese/chan/ui/controller/ImageViewerController.java @@ -313,8 +313,11 @@ private void saveShare(boolean share, PostImage postImage) { if (ChanSettings.saveThreadFolder.get()) { subFolderName = appendAdditionalSubDirectories(postImage); } else { - subFolderName = - presenter.getLoadable().site.name() + File.separator + presenter.getLoadable().boardCode; + String siteNameSafe = StringUtils.dirNameRemoveBadCharacters( + presenter.getLoadable().site.name() + ); + + subFolderName = siteNameSafe + File.separator + presenter.getLoadable().boardCode; } task.setSubFolder(subFolderName);