Merge pull request #5816 from ByteHamster/fix-full-sync-local
Fix full sync trying to handle local feeds
This commit is contained in:
commit
e78893305d
|
@ -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 {
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue