Merge pull request #4922 from ByteHamster/fix-null-local-folder-title

Fixed local folder name being set to null
This commit is contained in:
ByteHamster 2021-02-04 13:01:37 +01:00 committed by GitHub
commit 0e33daa74d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -190,7 +190,11 @@ public class AddFeedFragment extends Fragment {
if (documentFile == null) {
throw new IllegalArgumentException("Unable to retrieve document tree");
}
Feed dirFeed = new Feed(Feed.PREFIX_LOCAL_FOLDER + uri.toString(), null, documentFile.getName());
String title = documentFile.getName();
if (title == null) {
title = getString(R.string.local_folder);
}
Feed dirFeed = new Feed(Feed.PREFIX_LOCAL_FOLDER + uri.toString(), null, title);
dirFeed.setItems(Collections.emptyList());
dirFeed.setSortOrder(SortOrder.EPISODE_TITLE_A_Z);
Feed fromDatabase = DBTasks.updateFeed(getContext(), dirFeed, false);