mirror of
https://github.com/KokaKiwi/BarInsta
synced 2024-12-23 05:16:58 +00:00
Resolve PR comments
This commit is contained in:
parent
2d2ad6130b
commit
f0167f2d93
@ -53,7 +53,7 @@ public class DownloadsPreferencesFragment extends BasePreferencesFragment {
|
||||
private Preference getPrependUsernameToFilenamePreference(@NonNull final Context context) {
|
||||
final SwitchPreferenceCompat preference = new SwitchPreferenceCompat(context);
|
||||
preference.setKey(Constants.DOWNLOAD_PREPEND_USER_NAME);
|
||||
preference.setTitle("Prepend Username to Filename");
|
||||
preference.setTitle(R.string.download_prepend_username);
|
||||
preference.setIconSpaceReserved(false);
|
||||
return preference;
|
||||
}
|
||||
|
@ -142,7 +142,7 @@ public final class DownloadUtils {
|
||||
final String sliderPostfix,
|
||||
final String displayUrl,
|
||||
final String username) {
|
||||
final String usernamePrepend = "".equals(username) ? "" : "@" + username + "_";
|
||||
final String usernamePrepend = TextUtils.isEmpty(username) ? "" : "@" + username + "_";
|
||||
final String fileName = usernamePrepend + postId + sliderPostfix + getFileExtensionFromUrl(displayUrl);
|
||||
return new File(finalDir, fileName);
|
||||
}
|
||||
@ -228,7 +228,7 @@ public final class DownloadUtils {
|
||||
final Media child = sliderItems.get(i);
|
||||
if (child == null) continue;
|
||||
final String url = ResponseBodyUtils.getImageUrl(child);
|
||||
final File file = getDownloadChildSaveFile(downloadDir, media.getCode(), i + 1, url, username);
|
||||
final File file = getDownloadChildSaveFile(downloadDir, media.getCode(), i + 1, url, usernamePrepend);
|
||||
checkList.add(file.exists());
|
||||
}
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user