Merge pull request #5816 from ByteHamster/fix-full-sync-local

Fix full sync trying to handle local feeds
This commit is contained in:
ByteHamster 2022-03-25 22:20:41 +01:00 committed by GitHub
commit e78893305d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -101,7 +101,10 @@ public final class DBReader {
try (Cursor cursor = adapter.getFeedCursorDownloadUrls()) {
List<String> result = new ArrayList<>(cursor.getCount());
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;
} finally {

View File

@ -145,6 +145,10 @@ public class SyncService extends Worker {
Log.d(TAG, "Downloaded subscription changes: " + subscriptionChanges);
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)) {
Feed feed = new Feed(downloadUrl, null);
DownloadRequest.Builder builder = DownloadRequestCreator.create(feed);