Fix full sync trying to handle local feeds

This commit is contained in:
ByteHamster 2022-03-25 10:23:43 +01:00
parent 3d54aa7064
commit 9b1984548b
2 changed files with 8 additions and 1 deletions

View File

@ -101,7 +101,10 @@ public final class DBReader {
try (Cursor cursor = adapter.getFeedCursorDownloadUrls()) { try (Cursor cursor = adapter.getFeedCursorDownloadUrls()) {
List<String> result = new ArrayList<>(cursor.getCount()); List<String> result = new ArrayList<>(cursor.getCount());
while (cursor.moveToNext()) { while (cursor.moveToNext()) {
result.add(cursor.getString(1)); String url = cursor.getString(1);
if (url != null && !url.startsWith(Feed.PREFIX_LOCAL_FOLDER)) {
result.add(url);
}
} }
return result; return result;
} finally { } finally {

View File

@ -145,6 +145,10 @@ public class SyncService extends Worker {
Log.d(TAG, "Downloaded subscription changes: " + subscriptionChanges); Log.d(TAG, "Downloaded subscription changes: " + subscriptionChanges);
for (String downloadUrl : subscriptionChanges.getAdded()) { for (String downloadUrl : subscriptionChanges.getAdded()) {
if (!downloadUrl.startsWith("http")) { // Also matches https
Log.d(TAG, "Skipping url: " + downloadUrl);
continue;
}
if (!URLChecker.containsUrl(localSubscriptions, downloadUrl) && !queuedRemovedFeeds.contains(downloadUrl)) { if (!URLChecker.containsUrl(localSubscriptions, downloadUrl) && !queuedRemovedFeeds.contains(downloadUrl)) {
Feed feed = new Feed(downloadUrl, null); Feed feed = new Feed(downloadUrl, null);
DownloadRequest.Builder builder = DownloadRequestCreator.create(feed); DownloadRequest.Builder builder = DownloadRequestCreator.create(feed);