Fixed local folder name being set to null

This commit is contained in:
ByteHamster 2021-02-04 12:36:23 +01:00
parent 4af0f98d2f
commit 931bda4bed
1 changed files with 5 additions and 1 deletions

View File

@ -190,7 +190,11 @@ public class AddFeedFragment extends Fragment {
if (documentFile == null) { if (documentFile == null) {
throw new IllegalArgumentException("Unable to retrieve document tree"); 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.setItems(Collections.emptyList());
dirFeed.setSortOrder(SortOrder.EPISODE_TITLE_A_Z); dirFeed.setSortOrder(SortOrder.EPISODE_TITLE_A_Z);
Feed fromDatabase = DBTasks.updateFeed(getContext(), dirFeed, false); Feed fromDatabase = DBTasks.updateFeed(getContext(), dirFeed, false);