diff --git a/api/src/main/java/com/readrops/api/services/freshrss/FreshRSSDataSource.java b/api/src/main/java/com/readrops/api/services/freshrss/FreshRSSDataSource.java index a3e25493..ac4a8b56 100644 --- a/api/src/main/java/com/readrops/api/services/freshrss/FreshRSSDataSource.java +++ b/api/src/main/java/com/readrops/api/services/freshrss/FreshRSSDataSource.java @@ -5,15 +5,10 @@ import androidx.annotation.Nullable; import com.readrops.api.services.SyncResult; import com.readrops.api.services.SyncType; -import com.readrops.api.services.freshrss.adapters.FreshRSSFeedsAdapter; -import com.readrops.api.services.freshrss.adapters.FreshRSSFoldersAdapter; -import com.readrops.api.services.freshrss.adapters.FreshRSSItemsAdapter; import com.readrops.api.services.freshrss.json.FreshRSSUserInfo; import com.readrops.db.entities.Feed; import com.readrops.db.entities.Folder; import com.readrops.db.entities.Item; -import com.squareup.moshi.Moshi; -import com.squareup.moshi.Types; import java.io.StringReader; import java.util.List; @@ -38,14 +33,6 @@ public class FreshRSSDataSource { this.api = api; } - protected Moshi buildMoshi() { - return new Moshi.Builder() - .add(Types.newParameterizedType(List.class, Item.class), new FreshRSSItemsAdapter()) - .add(new FreshRSSFeedsAdapter()) - .add(new FreshRSSFoldersAdapter()) - .build(); - } - /** * Call token API to generate a new token from account credentials * diff --git a/api/src/main/java/com/readrops/api/services/nextcloudnews/NextNewsDataSource.java b/api/src/main/java/com/readrops/api/services/nextcloudnews/NextNewsDataSource.java index d39261c0..ed06044d 100644 --- a/api/src/main/java/com/readrops/api/services/nextcloudnews/NextNewsDataSource.java +++ b/api/src/main/java/com/readrops/api/services/nextcloudnews/NextNewsDataSource.java @@ -5,20 +5,15 @@ import android.content.res.Resources; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import com.readrops.db.entities.Feed; -import com.readrops.db.entities.Folder; -import com.readrops.db.entities.Item; import com.readrops.api.services.SyncResult; import com.readrops.api.services.SyncType; -import com.readrops.api.services.nextcloudnews.adapters.NextNewsFeedsAdapter; -import com.readrops.api.services.nextcloudnews.adapters.NextNewsFoldersAdapter; -import com.readrops.api.services.nextcloudnews.adapters.NextNewsItemsAdapter; import com.readrops.api.services.nextcloudnews.json.NextNewsUser; import com.readrops.api.utils.ConflictException; import com.readrops.api.utils.LibUtils; import com.readrops.api.utils.UnknownFormatException; -import com.squareup.moshi.Moshi; -import com.squareup.moshi.Types; +import com.readrops.db.entities.Feed; +import com.readrops.db.entities.Folder; +import com.readrops.db.entities.Item; import java.io.IOException; import java.util.ArrayList; @@ -40,14 +35,6 @@ public class NextNewsDataSource { this.api = api; } - protected Moshi buildMoshi() { - return new Moshi.Builder() - .add(new NextNewsFeedsAdapter()) - .add(new NextNewsFoldersAdapter()) - .add(Types.newParameterizedType(List.class, Item.class), new NextNewsItemsAdapter()) - .build(); - } - @Nullable public NextNewsUser login() throws IOException { Response response = api.getUser().execute(); diff --git a/app/src/main/java/com/readrops/app/repositories/ARepository.java b/app/src/main/java/com/readrops/app/repositories/ARepository.java index 51610b30..47425232 100644 --- a/app/src/main/java/com/readrops/app/repositories/ARepository.java +++ b/app/src/main/java/com/readrops/app/repositories/ARepository.java @@ -18,7 +18,6 @@ import com.readrops.db.entities.Feed; import com.readrops.db.entities.Folder; import com.readrops.db.entities.Item; import com.readrops.db.entities.account.Account; -import com.readrops.db.entities.account.AccountType; import org.koin.java.KoinJavaComponent; @@ -176,23 +175,6 @@ public abstract class ARepository { context.startService(intent); } - public static ARepository repositoryFactory(Account account, AccountType accountType, Context context) { - switch (accountType) { - case LOCAL: - return new LocalFeedRepository(null, Database.getInstance(context), context, account); - case NEXTCLOUD_NEWS: - return new NextNewsRepository(null, Database.getInstance(context), context, account); - case FRESHRSS: - return new FreshRSSRepository(null, Database.getInstance(context), context, account); - default: - throw new IllegalArgumentException("account type not supported"); - } - } - - public static ARepository repositoryFactory(Account account, Context context) { - return ARepository.repositoryFactory(account, account.getAccountType(), context); - } - public SyncResult getSyncResult() { return syncResult; }