diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 832fda076..c94189865 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -39,19 +39,19 @@
android:value=".ui.manga.MangaActivity" />
-
-
diff --git a/app/src/main/java/eu/kanade/mangafeed/data/caches/CacheManager.java b/app/src/main/java/eu/kanade/mangafeed/data/cache/CacheManager.java
similarity index 98%
rename from app/src/main/java/eu/kanade/mangafeed/data/caches/CacheManager.java
rename to app/src/main/java/eu/kanade/mangafeed/data/cache/CacheManager.java
index f43b1f1e5..2e0e3228f 100644
--- a/app/src/main/java/eu/kanade/mangafeed/data/caches/CacheManager.java
+++ b/app/src/main/java/eu/kanade/mangafeed/data/cache/CacheManager.java
@@ -1,4 +1,4 @@
-package eu.kanade.mangafeed.data.caches;
+package eu.kanade.mangafeed.data.cache;
import android.content.Context;
@@ -15,7 +15,7 @@ import java.io.OutputStream;
import java.lang.reflect.Type;
import java.util.List;
-import eu.kanade.mangafeed.data.models.Page;
+import eu.kanade.mangafeed.data.source.model.Page;
import eu.kanade.mangafeed.util.DiskUtils;
import okio.BufferedSink;
import okio.Okio;
diff --git a/app/src/main/java/eu/kanade/mangafeed/data/helpers/DatabaseHelper.java b/app/src/main/java/eu/kanade/mangafeed/data/database/DatabaseHelper.java
similarity index 92%
rename from app/src/main/java/eu/kanade/mangafeed/data/helpers/DatabaseHelper.java
rename to app/src/main/java/eu/kanade/mangafeed/data/database/DatabaseHelper.java
index d4e840000..019bf6d8d 100644
--- a/app/src/main/java/eu/kanade/mangafeed/data/helpers/DatabaseHelper.java
+++ b/app/src/main/java/eu/kanade/mangafeed/data/database/DatabaseHelper.java
@@ -1,4 +1,4 @@
-package eu.kanade.mangafeed.data.helpers;
+package eu.kanade.mangafeed.data.database;
import android.content.Context;
@@ -16,16 +16,16 @@ import com.pushtorefresh.storio.sqlite.queries.RawQuery;
import java.util.List;
-import eu.kanade.mangafeed.data.models.Chapter;
-import eu.kanade.mangafeed.data.models.ChapterStorIOSQLiteDeleteResolver;
-import eu.kanade.mangafeed.data.models.ChapterStorIOSQLiteGetResolver;
-import eu.kanade.mangafeed.data.models.ChapterStorIOSQLitePutResolver;
-import eu.kanade.mangafeed.data.models.Manga;
-import eu.kanade.mangafeed.data.models.MangaStorIOSQLiteDeleteResolver;
-import eu.kanade.mangafeed.data.models.MangaStorIOSQLitePutResolver;
-import eu.kanade.mangafeed.data.resolvers.MangaWithUnreadGetResolver;
-import eu.kanade.mangafeed.data.tables.ChaptersTable;
-import eu.kanade.mangafeed.data.tables.MangasTable;
+import eu.kanade.mangafeed.data.database.models.Chapter;
+import eu.kanade.mangafeed.data.database.models.ChapterStorIOSQLiteDeleteResolver;
+import eu.kanade.mangafeed.data.database.models.ChapterStorIOSQLiteGetResolver;
+import eu.kanade.mangafeed.data.database.models.ChapterStorIOSQLitePutResolver;
+import eu.kanade.mangafeed.data.database.models.Manga;
+import eu.kanade.mangafeed.data.database.models.MangaStorIOSQLiteDeleteResolver;
+import eu.kanade.mangafeed.data.database.models.MangaStorIOSQLitePutResolver;
+import eu.kanade.mangafeed.data.database.resolvers.MangaWithUnreadGetResolver;
+import eu.kanade.mangafeed.data.database.tables.ChaptersTable;
+import eu.kanade.mangafeed.data.database.tables.MangasTable;
import eu.kanade.mangafeed.util.ChapterRecognition;
import eu.kanade.mangafeed.util.PostResult;
import rx.Observable;
diff --git a/app/src/main/java/eu/kanade/mangafeed/data/helpers/DbOpenHelper.java b/app/src/main/java/eu/kanade/mangafeed/data/database/DbOpenHelper.java
similarity index 84%
rename from app/src/main/java/eu/kanade/mangafeed/data/helpers/DbOpenHelper.java
rename to app/src/main/java/eu/kanade/mangafeed/data/database/DbOpenHelper.java
index 3a4de35a5..65b0cdd17 100644
--- a/app/src/main/java/eu/kanade/mangafeed/data/helpers/DbOpenHelper.java
+++ b/app/src/main/java/eu/kanade/mangafeed/data/database/DbOpenHelper.java
@@ -1,12 +1,12 @@
-package eu.kanade.mangafeed.data.helpers;
+package eu.kanade.mangafeed.data.database;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.support.annotation.NonNull;
-import eu.kanade.mangafeed.data.tables.ChaptersTable;
-import eu.kanade.mangafeed.data.tables.MangasTable;
+import eu.kanade.mangafeed.data.database.tables.ChaptersTable;
+import eu.kanade.mangafeed.data.database.tables.MangasTable;
public class DbOpenHelper extends SQLiteOpenHelper {
diff --git a/app/src/main/java/eu/kanade/mangafeed/data/models/Chapter.java b/app/src/main/java/eu/kanade/mangafeed/data/database/models/Chapter.java
similarity index 93%
rename from app/src/main/java/eu/kanade/mangafeed/data/models/Chapter.java
rename to app/src/main/java/eu/kanade/mangafeed/data/database/models/Chapter.java
index 2f43cd208..eca4f5fc3 100644
--- a/app/src/main/java/eu/kanade/mangafeed/data/models/Chapter.java
+++ b/app/src/main/java/eu/kanade/mangafeed/data/database/models/Chapter.java
@@ -1,9 +1,9 @@
-package eu.kanade.mangafeed.data.models;
+package eu.kanade.mangafeed.data.database.models;
import com.pushtorefresh.storio.sqlite.annotations.StorIOSQLiteColumn;
import com.pushtorefresh.storio.sqlite.annotations.StorIOSQLiteType;
-import eu.kanade.mangafeed.data.tables.ChaptersTable;
+import eu.kanade.mangafeed.data.database.tables.ChaptersTable;
@StorIOSQLiteType(table = ChaptersTable.TABLE)
public class Chapter {
diff --git a/app/src/main/java/eu/kanade/mangafeed/data/models/Manga.java b/app/src/main/java/eu/kanade/mangafeed/data/database/models/Manga.java
similarity index 96%
rename from app/src/main/java/eu/kanade/mangafeed/data/models/Manga.java
rename to app/src/main/java/eu/kanade/mangafeed/data/database/models/Manga.java
index d886c3095..86ab30332 100644
--- a/app/src/main/java/eu/kanade/mangafeed/data/models/Manga.java
+++ b/app/src/main/java/eu/kanade/mangafeed/data/database/models/Manga.java
@@ -1,9 +1,9 @@
-package eu.kanade.mangafeed.data.models;
+package eu.kanade.mangafeed.data.database.models;
import com.pushtorefresh.storio.sqlite.annotations.StorIOSQLiteColumn;
import com.pushtorefresh.storio.sqlite.annotations.StorIOSQLiteType;
-import eu.kanade.mangafeed.data.tables.MangasTable;
+import eu.kanade.mangafeed.data.database.tables.MangasTable;
@StorIOSQLiteType(table = MangasTable.TABLE)
public class Manga {
diff --git a/app/src/main/java/eu/kanade/mangafeed/data/resolvers/MangaWithUnreadGetResolver.java b/app/src/main/java/eu/kanade/mangafeed/data/database/resolvers/MangaWithUnreadGetResolver.java
similarity index 65%
rename from app/src/main/java/eu/kanade/mangafeed/data/resolvers/MangaWithUnreadGetResolver.java
rename to app/src/main/java/eu/kanade/mangafeed/data/database/resolvers/MangaWithUnreadGetResolver.java
index f5e5eb888..a5a2f91a6 100644
--- a/app/src/main/java/eu/kanade/mangafeed/data/resolvers/MangaWithUnreadGetResolver.java
+++ b/app/src/main/java/eu/kanade/mangafeed/data/database/resolvers/MangaWithUnreadGetResolver.java
@@ -1,11 +1,11 @@
-package eu.kanade.mangafeed.data.resolvers;
+package eu.kanade.mangafeed.data.database.resolvers;
import android.database.Cursor;
import android.support.annotation.NonNull;
-import eu.kanade.mangafeed.data.models.Manga;
-import eu.kanade.mangafeed.data.models.MangaStorIOSQLiteGetResolver;
-import eu.kanade.mangafeed.data.tables.MangasTable;
+import eu.kanade.mangafeed.data.database.models.Manga;
+import eu.kanade.mangafeed.data.database.models.MangaStorIOSQLiteGetResolver;
+import eu.kanade.mangafeed.data.database.tables.MangasTable;
public class MangaWithUnreadGetResolver extends MangaStorIOSQLiteGetResolver {
diff --git a/app/src/main/java/eu/kanade/mangafeed/data/tables/CategoriesTable.java b/app/src/main/java/eu/kanade/mangafeed/data/database/tables/CategoriesTable.java
similarity index 86%
rename from app/src/main/java/eu/kanade/mangafeed/data/tables/CategoriesTable.java
rename to app/src/main/java/eu/kanade/mangafeed/data/database/tables/CategoriesTable.java
index 5e5c56642..bc56409e6 100644
--- a/app/src/main/java/eu/kanade/mangafeed/data/tables/CategoriesTable.java
+++ b/app/src/main/java/eu/kanade/mangafeed/data/database/tables/CategoriesTable.java
@@ -1,4 +1,4 @@
-package eu.kanade.mangafeed.data.tables;
+package eu.kanade.mangafeed.data.database.tables;
import android.support.annotation.NonNull;
diff --git a/app/src/main/java/eu/kanade/mangafeed/data/tables/ChaptersTable.java b/app/src/main/java/eu/kanade/mangafeed/data/database/tables/ChaptersTable.java
similarity index 96%
rename from app/src/main/java/eu/kanade/mangafeed/data/tables/ChaptersTable.java
rename to app/src/main/java/eu/kanade/mangafeed/data/database/tables/ChaptersTable.java
index 8dc9d5179..548e6b874 100644
--- a/app/src/main/java/eu/kanade/mangafeed/data/tables/ChaptersTable.java
+++ b/app/src/main/java/eu/kanade/mangafeed/data/database/tables/ChaptersTable.java
@@ -1,4 +1,4 @@
-package eu.kanade.mangafeed.data.tables;
+package eu.kanade.mangafeed.data.database.tables;
import android.support.annotation.NonNull;
diff --git a/app/src/main/java/eu/kanade/mangafeed/data/tables/MangasCategoriesTable.java b/app/src/main/java/eu/kanade/mangafeed/data/database/tables/MangasCategoriesTable.java
similarity index 87%
rename from app/src/main/java/eu/kanade/mangafeed/data/tables/MangasCategoriesTable.java
rename to app/src/main/java/eu/kanade/mangafeed/data/database/tables/MangasCategoriesTable.java
index 9b641139c..4799710f4 100644
--- a/app/src/main/java/eu/kanade/mangafeed/data/tables/MangasCategoriesTable.java
+++ b/app/src/main/java/eu/kanade/mangafeed/data/database/tables/MangasCategoriesTable.java
@@ -1,4 +1,4 @@
-package eu.kanade.mangafeed.data.tables;
+package eu.kanade.mangafeed.data.database.tables;
import android.support.annotation.NonNull;
diff --git a/app/src/main/java/eu/kanade/mangafeed/data/tables/MangasTable.java b/app/src/main/java/eu/kanade/mangafeed/data/database/tables/MangasTable.java
similarity index 98%
rename from app/src/main/java/eu/kanade/mangafeed/data/tables/MangasTable.java
rename to app/src/main/java/eu/kanade/mangafeed/data/database/tables/MangasTable.java
index 732343413..57a1b6445 100644
--- a/app/src/main/java/eu/kanade/mangafeed/data/tables/MangasTable.java
+++ b/app/src/main/java/eu/kanade/mangafeed/data/database/tables/MangasTable.java
@@ -1,4 +1,4 @@
-package eu.kanade.mangafeed.data.tables;
+package eu.kanade.mangafeed.data.database.tables;
import android.support.annotation.NonNull;
diff --git a/app/src/main/java/eu/kanade/mangafeed/data/helpers/DownloadManager.java b/app/src/main/java/eu/kanade/mangafeed/data/download/DownloadManager.java
similarity index 96%
rename from app/src/main/java/eu/kanade/mangafeed/data/helpers/DownloadManager.java
rename to app/src/main/java/eu/kanade/mangafeed/data/download/DownloadManager.java
index b1cc6d4d9..b5f11659a 100644
--- a/app/src/main/java/eu/kanade/mangafeed/data/helpers/DownloadManager.java
+++ b/app/src/main/java/eu/kanade/mangafeed/data/download/DownloadManager.java
@@ -1,4 +1,4 @@
-package eu.kanade.mangafeed.data.helpers;
+package eu.kanade.mangafeed.data.download;
import android.content.Context;
@@ -16,14 +16,15 @@ import java.net.MalformedURLException;
import java.net.URL;
import java.util.List;
-import eu.kanade.mangafeed.data.models.Chapter;
-import eu.kanade.mangafeed.data.models.Download;
-import eu.kanade.mangafeed.data.models.DownloadQueue;
-import eu.kanade.mangafeed.data.models.Manga;
-import eu.kanade.mangafeed.data.models.Page;
-import eu.kanade.mangafeed.data.services.DownloadService;
-import eu.kanade.mangafeed.events.DownloadChaptersEvent;
-import eu.kanade.mangafeed.sources.base.Source;
+import eu.kanade.mangafeed.data.database.models.Chapter;
+import eu.kanade.mangafeed.data.database.models.Manga;
+import eu.kanade.mangafeed.data.download.model.Download;
+import eu.kanade.mangafeed.data.download.model.DownloadQueue;
+import eu.kanade.mangafeed.data.source.model.Page;
+import eu.kanade.mangafeed.data.preference.PreferencesHelper;
+import eu.kanade.mangafeed.data.source.SourceManager;
+import eu.kanade.mangafeed.event.DownloadChaptersEvent;
+import eu.kanade.mangafeed.data.source.base.Source;
import eu.kanade.mangafeed.util.DiskUtils;
import eu.kanade.mangafeed.util.DynamicConcurrentMergeOperator;
import rx.Observable;
diff --git a/app/src/main/java/eu/kanade/mangafeed/data/services/DownloadService.java b/app/src/main/java/eu/kanade/mangafeed/data/download/DownloadService.java
similarity index 95%
rename from app/src/main/java/eu/kanade/mangafeed/data/services/DownloadService.java
rename to app/src/main/java/eu/kanade/mangafeed/data/download/DownloadService.java
index 730acda6e..2b648a845 100644
--- a/app/src/main/java/eu/kanade/mangafeed/data/services/DownloadService.java
+++ b/app/src/main/java/eu/kanade/mangafeed/data/download/DownloadService.java
@@ -1,4 +1,4 @@
-package eu.kanade.mangafeed.data.services;
+package eu.kanade.mangafeed.data.download;
import android.app.Service;
import android.content.Context;
@@ -12,8 +12,7 @@ import javax.inject.Inject;
import de.greenrobot.event.EventBus;
import eu.kanade.mangafeed.App;
-import eu.kanade.mangafeed.data.helpers.DownloadManager;
-import eu.kanade.mangafeed.events.DownloadChaptersEvent;
+import eu.kanade.mangafeed.event.DownloadChaptersEvent;
import eu.kanade.mangafeed.util.ContentObservable;
import eu.kanade.mangafeed.util.EventBusHook;
import eu.kanade.mangafeed.util.NetworkUtil;
diff --git a/app/src/main/java/eu/kanade/mangafeed/data/models/Download.java b/app/src/main/java/eu/kanade/mangafeed/data/download/model/Download.java
similarity index 81%
rename from app/src/main/java/eu/kanade/mangafeed/data/models/Download.java
rename to app/src/main/java/eu/kanade/mangafeed/data/download/model/Download.java
index 1a8369610..07b39908e 100644
--- a/app/src/main/java/eu/kanade/mangafeed/data/models/Download.java
+++ b/app/src/main/java/eu/kanade/mangafeed/data/download/model/Download.java
@@ -1,9 +1,12 @@
-package eu.kanade.mangafeed.data.models;
+package eu.kanade.mangafeed.data.download.model;
import java.io.File;
import java.util.List;
-import eu.kanade.mangafeed.sources.base.Source;
+import eu.kanade.mangafeed.data.database.models.Chapter;
+import eu.kanade.mangafeed.data.database.models.Manga;
+import eu.kanade.mangafeed.data.source.model.Page;
+import eu.kanade.mangafeed.data.source.base.Source;
import rx.subjects.PublishSubject;
public class Download {
diff --git a/app/src/main/java/eu/kanade/mangafeed/data/models/DownloadQueue.java b/app/src/main/java/eu/kanade/mangafeed/data/download/model/DownloadQueue.java
similarity index 91%
rename from app/src/main/java/eu/kanade/mangafeed/data/models/DownloadQueue.java
rename to app/src/main/java/eu/kanade/mangafeed/data/download/model/DownloadQueue.java
index 9bbc8ee07..2581f9998 100644
--- a/app/src/main/java/eu/kanade/mangafeed/data/models/DownloadQueue.java
+++ b/app/src/main/java/eu/kanade/mangafeed/data/download/model/DownloadQueue.java
@@ -1,8 +1,9 @@
-package eu.kanade.mangafeed.data.models;
+package eu.kanade.mangafeed.data.download.model;
import java.util.ArrayList;
import java.util.List;
+import eu.kanade.mangafeed.data.download.model.Download;
import rx.Observable;
import rx.subjects.PublishSubject;
diff --git a/app/src/main/java/eu/kanade/mangafeed/data/helpers/NetworkHelper.java b/app/src/main/java/eu/kanade/mangafeed/data/network/NetworkHelper.java
similarity index 68%
rename from app/src/main/java/eu/kanade/mangafeed/data/helpers/NetworkHelper.java
rename to app/src/main/java/eu/kanade/mangafeed/data/network/NetworkHelper.java
index 30242c9c1..e5ae5bb5a 100644
--- a/app/src/main/java/eu/kanade/mangafeed/data/helpers/NetworkHelper.java
+++ b/app/src/main/java/eu/kanade/mangafeed/data/network/NetworkHelper.java
@@ -1,25 +1,17 @@
-package eu.kanade.mangafeed.data.helpers;
+package eu.kanade.mangafeed.data.network;
import com.squareup.okhttp.CacheControl;
import com.squareup.okhttp.Headers;
-import com.squareup.okhttp.MediaType;
import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.Request;
import com.squareup.okhttp.RequestBody;
import com.squareup.okhttp.Response;
-import com.squareup.okhttp.ResponseBody;
-import java.io.IOException;
import java.net.CookieManager;
import java.net.CookiePolicy;
import java.net.CookieStore;
-import okio.Buffer;
-import okio.BufferedSource;
-import okio.ForwardingSource;
-import okio.Okio;
-import okio.Source;
import rx.Observable;
public final class NetworkHelper {
@@ -121,48 +113,4 @@ public final class NetworkHelper {
return cookieManager.getCookieStore();
}
- private static class ProgressResponseBody extends ResponseBody {
-
- private final ResponseBody responseBody;
- private final ProgressListener progressListener;
- private BufferedSource bufferedSource;
-
- public ProgressResponseBody(ResponseBody responseBody, ProgressListener progressListener) {
- this.responseBody = responseBody;
- this.progressListener = progressListener;
- }
-
- @Override public MediaType contentType() {
- return responseBody.contentType();
- }
-
- @Override public long contentLength() throws IOException {
- return responseBody.contentLength();
- }
-
- @Override public BufferedSource source() throws IOException {
- if (bufferedSource == null) {
- bufferedSource = Okio.buffer(source(responseBody.source()));
- }
- return bufferedSource;
- }
-
- private Source source(Source source) {
- return new ForwardingSource(source) {
- long totalBytesRead = 0L;
- @Override public long read(Buffer sink, long byteCount) throws IOException {
- long bytesRead = super.read(sink, byteCount);
- // read() returns the number of bytes read, or -1 if this source is exhausted.
- totalBytesRead += bytesRead != -1 ? bytesRead : 0;
- progressListener.update(totalBytesRead, responseBody.contentLength(), bytesRead == -1);
- return bytesRead;
- }
- };
- }
- }
-
- public interface ProgressListener {
- void update(long bytesRead, long contentLength, boolean done);
- }
-
}
diff --git a/app/src/main/java/eu/kanade/mangafeed/data/network/ProgressListener.java b/app/src/main/java/eu/kanade/mangafeed/data/network/ProgressListener.java
new file mode 100644
index 000000000..cdab93dcd
--- /dev/null
+++ b/app/src/main/java/eu/kanade/mangafeed/data/network/ProgressListener.java
@@ -0,0 +1,5 @@
+package eu.kanade.mangafeed.data.network;
+
+public interface ProgressListener {
+ void update(long bytesRead, long contentLength, boolean done);
+}
\ No newline at end of file
diff --git a/app/src/main/java/eu/kanade/mangafeed/data/network/ProgressResponseBody.java b/app/src/main/java/eu/kanade/mangafeed/data/network/ProgressResponseBody.java
new file mode 100644
index 000000000..58a9654bc
--- /dev/null
+++ b/app/src/main/java/eu/kanade/mangafeed/data/network/ProgressResponseBody.java
@@ -0,0 +1,52 @@
+package eu.kanade.mangafeed.data.network;
+
+import com.squareup.okhttp.MediaType;
+import com.squareup.okhttp.ResponseBody;
+
+import java.io.IOException;
+
+import okio.Buffer;
+import okio.BufferedSource;
+import okio.ForwardingSource;
+import okio.Okio;
+import okio.Source;
+
+public class ProgressResponseBody extends ResponseBody {
+
+ private final ResponseBody responseBody;
+ private final ProgressListener progressListener;
+ private BufferedSource bufferedSource;
+
+ public ProgressResponseBody(ResponseBody responseBody, ProgressListener progressListener) {
+ this.responseBody = responseBody;
+ this.progressListener = progressListener;
+ }
+
+ @Override public MediaType contentType() {
+ return responseBody.contentType();
+ }
+
+ @Override public long contentLength() throws IOException {
+ return responseBody.contentLength();
+ }
+
+ @Override public BufferedSource source() throws IOException {
+ if (bufferedSource == null) {
+ bufferedSource = Okio.buffer(source(responseBody.source()));
+ }
+ return bufferedSource;
+ }
+
+ private Source source(Source source) {
+ return new ForwardingSource(source) {
+ long totalBytesRead = 0L;
+ @Override public long read(Buffer sink, long byteCount) throws IOException {
+ long bytesRead = super.read(sink, byteCount);
+ // read() returns the number of bytes read, or -1 if this source is exhausted.
+ totalBytesRead += bytesRead != -1 ? bytesRead : 0;
+ progressListener.update(totalBytesRead, responseBody.contentLength(), bytesRead == -1);
+ return bytesRead;
+ }
+ };
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/eu/kanade/mangafeed/data/helpers/PreferencesHelper.java b/app/src/main/java/eu/kanade/mangafeed/data/preference/PreferencesHelper.java
similarity index 96%
rename from app/src/main/java/eu/kanade/mangafeed/data/helpers/PreferencesHelper.java
rename to app/src/main/java/eu/kanade/mangafeed/data/preference/PreferencesHelper.java
index d772515c5..a6a0417b4 100644
--- a/app/src/main/java/eu/kanade/mangafeed/data/helpers/PreferencesHelper.java
+++ b/app/src/main/java/eu/kanade/mangafeed/data/preference/PreferencesHelper.java
@@ -1,4 +1,4 @@
-package eu.kanade.mangafeed.data.helpers;
+package eu.kanade.mangafeed.data.preference;
import android.content.Context;
import android.content.SharedPreferences;
@@ -7,7 +7,7 @@ import android.preference.PreferenceManager;
import com.f2prateek.rx.preferences.RxSharedPreferences;
import eu.kanade.mangafeed.R;
-import eu.kanade.mangafeed.sources.base.Source;
+import eu.kanade.mangafeed.data.source.base.Source;
import eu.kanade.mangafeed.util.DiskUtils;
import rx.Observable;
diff --git a/app/src/main/java/eu/kanade/mangafeed/data/helpers/SourceManager.java b/app/src/main/java/eu/kanade/mangafeed/data/source/SourceManager.java
similarity index 82%
rename from app/src/main/java/eu/kanade/mangafeed/data/helpers/SourceManager.java
rename to app/src/main/java/eu/kanade/mangafeed/data/source/SourceManager.java
index 9087e1234..05bd4aead 100644
--- a/app/src/main/java/eu/kanade/mangafeed/data/helpers/SourceManager.java
+++ b/app/src/main/java/eu/kanade/mangafeed/data/source/SourceManager.java
@@ -1,4 +1,4 @@
-package eu.kanade.mangafeed.data.helpers;
+package eu.kanade.mangafeed.data.source;
import android.content.Context;
@@ -6,10 +6,10 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
-import eu.kanade.mangafeed.sources.Batoto;
-import eu.kanade.mangafeed.sources.Mangahere;
-import eu.kanade.mangafeed.sources.Mangafox;
-import eu.kanade.mangafeed.sources.base.Source;
+import eu.kanade.mangafeed.data.source.online.english.Batoto;
+import eu.kanade.mangafeed.data.source.online.english.Mangahere;
+import eu.kanade.mangafeed.data.source.online.english.Mangafox;
+import eu.kanade.mangafeed.data.source.base.Source;
public class SourceManager {
diff --git a/app/src/main/java/eu/kanade/mangafeed/sources/base/BaseSource.java b/app/src/main/java/eu/kanade/mangafeed/data/source/base/BaseSource.java
similarity index 95%
rename from app/src/main/java/eu/kanade/mangafeed/sources/base/BaseSource.java
rename to app/src/main/java/eu/kanade/mangafeed/data/source/base/BaseSource.java
index 14fb79416..8526d9298 100644
--- a/app/src/main/java/eu/kanade/mangafeed/sources/base/BaseSource.java
+++ b/app/src/main/java/eu/kanade/mangafeed/data/source/base/BaseSource.java
@@ -1,12 +1,12 @@
-package eu.kanade.mangafeed.sources.base;
+package eu.kanade.mangafeed.data.source.base;
import com.squareup.okhttp.Headers;
import com.squareup.okhttp.Response;
import java.util.List;
-import eu.kanade.mangafeed.data.models.Chapter;
-import eu.kanade.mangafeed.data.models.Manga;
+import eu.kanade.mangafeed.data.database.models.Chapter;
+import eu.kanade.mangafeed.data.database.models.Manga;
import rx.Observable;
public abstract class BaseSource {
diff --git a/app/src/main/java/eu/kanade/mangafeed/sources/base/Source.java b/app/src/main/java/eu/kanade/mangafeed/data/source/base/Source.java
similarity index 94%
rename from app/src/main/java/eu/kanade/mangafeed/sources/base/Source.java
rename to app/src/main/java/eu/kanade/mangafeed/data/source/base/Source.java
index f8040875f..2c3398e75 100644
--- a/app/src/main/java/eu/kanade/mangafeed/sources/base/Source.java
+++ b/app/src/main/java/eu/kanade/mangafeed/data/source/base/Source.java
@@ -1,4 +1,4 @@
-package eu.kanade.mangafeed.sources.base;
+package eu.kanade.mangafeed.data.source.base;
import android.content.Context;
@@ -12,12 +12,12 @@ import java.util.List;
import javax.inject.Inject;
import eu.kanade.mangafeed.App;
-import eu.kanade.mangafeed.data.caches.CacheManager;
-import eu.kanade.mangafeed.data.helpers.NetworkHelper;
-import eu.kanade.mangafeed.data.helpers.PreferencesHelper;
-import eu.kanade.mangafeed.data.models.Chapter;
-import eu.kanade.mangafeed.data.models.Manga;
-import eu.kanade.mangafeed.data.models.Page;
+import eu.kanade.mangafeed.data.cache.CacheManager;
+import eu.kanade.mangafeed.data.network.NetworkHelper;
+import eu.kanade.mangafeed.data.preference.PreferencesHelper;
+import eu.kanade.mangafeed.data.database.models.Chapter;
+import eu.kanade.mangafeed.data.database.models.Manga;
+import eu.kanade.mangafeed.data.source.model.Page;
import rx.Observable;
import rx.schedulers.Schedulers;
diff --git a/app/src/main/java/eu/kanade/mangafeed/data/models/Page.java b/app/src/main/java/eu/kanade/mangafeed/data/source/model/Page.java
similarity index 92%
rename from app/src/main/java/eu/kanade/mangafeed/data/models/Page.java
rename to app/src/main/java/eu/kanade/mangafeed/data/source/model/Page.java
index 03289333c..6ccdce66f 100644
--- a/app/src/main/java/eu/kanade/mangafeed/data/models/Page.java
+++ b/app/src/main/java/eu/kanade/mangafeed/data/source/model/Page.java
@@ -1,9 +1,9 @@
-package eu.kanade.mangafeed.data.models;
+package eu.kanade.mangafeed.data.source.model;
-import eu.kanade.mangafeed.data.helpers.NetworkHelper;
+import eu.kanade.mangafeed.data.network.ProgressListener;
import rx.subjects.PublishSubject;
-public class Page implements NetworkHelper.ProgressListener {
+public class Page implements ProgressListener {
private int pageNumber;
private String url;
diff --git a/app/src/main/java/eu/kanade/mangafeed/sources/Batoto.java b/app/src/main/java/eu/kanade/mangafeed/data/source/online/english/Batoto.java
similarity index 97%
rename from app/src/main/java/eu/kanade/mangafeed/sources/Batoto.java
rename to app/src/main/java/eu/kanade/mangafeed/data/source/online/english/Batoto.java
index 7a8fde709..b9158dd20 100644
--- a/app/src/main/java/eu/kanade/mangafeed/sources/Batoto.java
+++ b/app/src/main/java/eu/kanade/mangafeed/data/source/online/english/Batoto.java
@@ -1,4 +1,4 @@
-package eu.kanade.mangafeed.sources;
+package eu.kanade.mangafeed.data.source.online.english;
import android.content.Context;
@@ -21,10 +21,10 @@ import java.util.Date;
import java.util.List;
import java.util.Locale;
-import eu.kanade.mangafeed.data.helpers.SourceManager;
-import eu.kanade.mangafeed.data.models.Chapter;
-import eu.kanade.mangafeed.data.models.Manga;
-import eu.kanade.mangafeed.sources.base.Source;
+import eu.kanade.mangafeed.data.source.SourceManager;
+import eu.kanade.mangafeed.data.database.models.Chapter;
+import eu.kanade.mangafeed.data.database.models.Manga;
+import eu.kanade.mangafeed.data.source.base.Source;
import rx.Observable;
public class Batoto extends Source {
@@ -400,4 +400,3 @@ public class Batoto extends Source {
}
}
-
diff --git a/app/src/main/java/eu/kanade/mangafeed/sources/Mangafox.java b/app/src/main/java/eu/kanade/mangafeed/data/source/online/english/Mangafox.java
similarity index 95%
rename from app/src/main/java/eu/kanade/mangafeed/sources/Mangafox.java
rename to app/src/main/java/eu/kanade/mangafeed/data/source/online/english/Mangafox.java
index 01e001181..1d4fe2b47 100644
--- a/app/src/main/java/eu/kanade/mangafeed/sources/Mangafox.java
+++ b/app/src/main/java/eu/kanade/mangafeed/data/source/online/english/Mangafox.java
@@ -1,4 +1,4 @@
-package eu.kanade.mangafeed.sources;
+package eu.kanade.mangafeed.data.source.online.english;
import android.content.Context;
@@ -10,10 +10,10 @@ import org.jsoup.select.Elements;
import java.util.ArrayList;
import java.util.List;
-import eu.kanade.mangafeed.data.helpers.SourceManager;
-import eu.kanade.mangafeed.data.models.Chapter;
-import eu.kanade.mangafeed.data.models.Manga;
-import eu.kanade.mangafeed.sources.base.Source;
+import eu.kanade.mangafeed.data.source.SourceManager;
+import eu.kanade.mangafeed.data.database.models.Chapter;
+import eu.kanade.mangafeed.data.database.models.Manga;
+import eu.kanade.mangafeed.data.source.base.Source;
public class Mangafox extends Source {
diff --git a/app/src/main/java/eu/kanade/mangafeed/sources/Mangahere.java b/app/src/main/java/eu/kanade/mangafeed/data/source/online/english/Mangahere.java
similarity index 97%
rename from app/src/main/java/eu/kanade/mangafeed/sources/Mangahere.java
rename to app/src/main/java/eu/kanade/mangafeed/data/source/online/english/Mangahere.java
index 02a3cf2e0..2b2655c08 100644
--- a/app/src/main/java/eu/kanade/mangafeed/sources/Mangahere.java
+++ b/app/src/main/java/eu/kanade/mangafeed/data/source/online/english/Mangahere.java
@@ -1,4 +1,4 @@
-package eu.kanade.mangafeed.sources;
+package eu.kanade.mangafeed.data.source.online.english;
import android.content.Context;
@@ -15,10 +15,10 @@ import java.util.Date;
import java.util.List;
import java.util.Locale;
-import eu.kanade.mangafeed.data.helpers.SourceManager;
-import eu.kanade.mangafeed.data.models.Chapter;
-import eu.kanade.mangafeed.data.models.Manga;
-import eu.kanade.mangafeed.sources.base.Source;
+import eu.kanade.mangafeed.data.source.SourceManager;
+import eu.kanade.mangafeed.data.database.models.Chapter;
+import eu.kanade.mangafeed.data.database.models.Manga;
+import eu.kanade.mangafeed.data.source.base.Source;
import rx.Observable;
public class Mangahere extends Source {
diff --git a/app/src/main/java/eu/kanade/mangafeed/data/services/LibraryUpdateService.java b/app/src/main/java/eu/kanade/mangafeed/data/sync/LibraryUpdateService.java
similarity index 96%
rename from app/src/main/java/eu/kanade/mangafeed/data/services/LibraryUpdateService.java
rename to app/src/main/java/eu/kanade/mangafeed/data/sync/LibraryUpdateService.java
index bce498cc2..fd618872f 100644
--- a/app/src/main/java/eu/kanade/mangafeed/data/services/LibraryUpdateService.java
+++ b/app/src/main/java/eu/kanade/mangafeed/data/sync/LibraryUpdateService.java
@@ -1,4 +1,4 @@
-package eu.kanade.mangafeed.data.services;
+package eu.kanade.mangafeed.data.sync;
import android.app.Service;
import android.content.BroadcastReceiver;
@@ -15,9 +15,9 @@ import javax.inject.Inject;
import eu.kanade.mangafeed.App;
import eu.kanade.mangafeed.BuildConfig;
import eu.kanade.mangafeed.R;
-import eu.kanade.mangafeed.data.helpers.DatabaseHelper;
-import eu.kanade.mangafeed.data.helpers.SourceManager;
-import eu.kanade.mangafeed.data.models.Manga;
+import eu.kanade.mangafeed.data.database.DatabaseHelper;
+import eu.kanade.mangafeed.data.source.SourceManager;
+import eu.kanade.mangafeed.data.database.models.Manga;
import eu.kanade.mangafeed.util.AndroidComponentUtil;
import eu.kanade.mangafeed.util.NetworkUtil;
import eu.kanade.mangafeed.util.NotificationUtil;
diff --git a/app/src/main/java/eu/kanade/mangafeed/events/ChapterCountEvent.java b/app/src/main/java/eu/kanade/mangafeed/event/ChapterCountEvent.java
similarity index 84%
rename from app/src/main/java/eu/kanade/mangafeed/events/ChapterCountEvent.java
rename to app/src/main/java/eu/kanade/mangafeed/event/ChapterCountEvent.java
index f5de50ec9..4bed4ad88 100644
--- a/app/src/main/java/eu/kanade/mangafeed/events/ChapterCountEvent.java
+++ b/app/src/main/java/eu/kanade/mangafeed/event/ChapterCountEvent.java
@@ -1,4 +1,4 @@
-package eu.kanade.mangafeed.events;
+package eu.kanade.mangafeed.event;
public class ChapterCountEvent {
private int count;
diff --git a/app/src/main/java/eu/kanade/mangafeed/events/DownloadChaptersEvent.java b/app/src/main/java/eu/kanade/mangafeed/event/DownloadChaptersEvent.java
similarity index 73%
rename from app/src/main/java/eu/kanade/mangafeed/events/DownloadChaptersEvent.java
rename to app/src/main/java/eu/kanade/mangafeed/event/DownloadChaptersEvent.java
index 0ff3de978..855ec2433 100644
--- a/app/src/main/java/eu/kanade/mangafeed/events/DownloadChaptersEvent.java
+++ b/app/src/main/java/eu/kanade/mangafeed/event/DownloadChaptersEvent.java
@@ -1,9 +1,9 @@
-package eu.kanade.mangafeed.events;
+package eu.kanade.mangafeed.event;
import java.util.List;
-import eu.kanade.mangafeed.data.models.Chapter;
-import eu.kanade.mangafeed.data.models.Manga;
+import eu.kanade.mangafeed.data.database.models.Chapter;
+import eu.kanade.mangafeed.data.database.models.Manga;
public class DownloadChaptersEvent {
private Manga manga;
diff --git a/app/src/main/java/eu/kanade/mangafeed/events/SourceMangaChapterEvent.java b/app/src/main/java/eu/kanade/mangafeed/event/SourceMangaChapterEvent.java
similarity index 71%
rename from app/src/main/java/eu/kanade/mangafeed/events/SourceMangaChapterEvent.java
rename to app/src/main/java/eu/kanade/mangafeed/event/SourceMangaChapterEvent.java
index c26b8e920..b08eb6fbf 100644
--- a/app/src/main/java/eu/kanade/mangafeed/events/SourceMangaChapterEvent.java
+++ b/app/src/main/java/eu/kanade/mangafeed/event/SourceMangaChapterEvent.java
@@ -1,8 +1,8 @@
-package eu.kanade.mangafeed.events;
+package eu.kanade.mangafeed.event;
-import eu.kanade.mangafeed.data.models.Chapter;
-import eu.kanade.mangafeed.data.models.Manga;
-import eu.kanade.mangafeed.sources.base.Source;
+import eu.kanade.mangafeed.data.database.models.Chapter;
+import eu.kanade.mangafeed.data.database.models.Manga;
+import eu.kanade.mangafeed.data.source.base.Source;
public class SourceMangaChapterEvent {
diff --git a/app/src/main/java/eu/kanade/mangafeed/injection/component/AppComponent.java b/app/src/main/java/eu/kanade/mangafeed/injection/component/AppComponent.java
index f5c99ba06..893c4cfbc 100644
--- a/app/src/main/java/eu/kanade/mangafeed/injection/component/AppComponent.java
+++ b/app/src/main/java/eu/kanade/mangafeed/injection/component/AppComponent.java
@@ -5,8 +5,8 @@ import android.app.Application;
import javax.inject.Singleton;
import dagger.Component;
-import eu.kanade.mangafeed.data.services.DownloadService;
-import eu.kanade.mangafeed.data.services.LibraryUpdateService;
+import eu.kanade.mangafeed.data.download.DownloadService;
+import eu.kanade.mangafeed.data.sync.LibraryUpdateService;
import eu.kanade.mangafeed.injection.module.AppModule;
import eu.kanade.mangafeed.injection.module.DataModule;
import eu.kanade.mangafeed.ui.catalogue.CataloguePresenter;
@@ -17,10 +17,10 @@ import eu.kanade.mangafeed.ui.manga.chapter.ChaptersPresenter;
import eu.kanade.mangafeed.ui.manga.info.MangaInfoPresenter;
import eu.kanade.mangafeed.ui.reader.ReaderPresenter;
import eu.kanade.mangafeed.ui.catalogue.SourcePresenter;
-import eu.kanade.mangafeed.sources.base.Source;
+import eu.kanade.mangafeed.data.source.base.Source;
import eu.kanade.mangafeed.ui.reader.ReaderActivity;
-import eu.kanade.mangafeed.ui.preference.SettingsAccountsFragment;
-import eu.kanade.mangafeed.ui.preference.SettingsDownloadsFragment;
+import eu.kanade.mangafeed.ui.setting.SettingsAccountsFragment;
+import eu.kanade.mangafeed.ui.setting.SettingsDownloadsFragment;
@Singleton
@Component(
diff --git a/app/src/main/java/eu/kanade/mangafeed/injection/module/DataModule.java b/app/src/main/java/eu/kanade/mangafeed/injection/module/DataModule.java
index c81f8cbb8..a02d567c7 100644
--- a/app/src/main/java/eu/kanade/mangafeed/injection/module/DataModule.java
+++ b/app/src/main/java/eu/kanade/mangafeed/injection/module/DataModule.java
@@ -6,12 +6,12 @@ import javax.inject.Singleton;
import dagger.Module;
import dagger.Provides;
-import eu.kanade.mangafeed.data.caches.CacheManager;
-import eu.kanade.mangafeed.data.helpers.DatabaseHelper;
-import eu.kanade.mangafeed.data.helpers.DownloadManager;
-import eu.kanade.mangafeed.data.helpers.NetworkHelper;
-import eu.kanade.mangafeed.data.helpers.PreferencesHelper;
-import eu.kanade.mangafeed.data.helpers.SourceManager;
+import eu.kanade.mangafeed.data.cache.CacheManager;
+import eu.kanade.mangafeed.data.database.DatabaseHelper;
+import eu.kanade.mangafeed.data.download.DownloadManager;
+import eu.kanade.mangafeed.data.network.NetworkHelper;
+import eu.kanade.mangafeed.data.preference.PreferencesHelper;
+import eu.kanade.mangafeed.data.source.SourceManager;
/**
* Provide dependencies to the DataManager, mainly Helper classes and Retrofit services.
diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/CatalogueFragment.java b/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/CatalogueFragment.java
index 0d7668397..61fd11891 100644
--- a/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/CatalogueFragment.java
+++ b/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/CatalogueFragment.java
@@ -21,7 +21,7 @@ import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnItemClick;
import eu.kanade.mangafeed.R;
-import eu.kanade.mangafeed.data.models.Manga;
+import eu.kanade.mangafeed.data.database.models.Manga;
import eu.kanade.mangafeed.ui.manga.MangaActivity;
import eu.kanade.mangafeed.ui.base.fragment.BaseRxFragment;
import eu.kanade.mangafeed.util.PageBundle;
diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/CatalogueHolder.java b/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/CatalogueHolder.java
index 0ce9bb8f7..a53502492 100644
--- a/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/CatalogueHolder.java
+++ b/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/CatalogueHolder.java
@@ -8,7 +8,7 @@ import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import eu.kanade.mangafeed.R;
-import eu.kanade.mangafeed.data.models.Manga;
+import eu.kanade.mangafeed.data.database.models.Manga;
import uk.co.ribot.easyadapter.ItemViewHolder;
import uk.co.ribot.easyadapter.PositionInfo;
import uk.co.ribot.easyadapter.annotations.LayoutId;
diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/CataloguePresenter.java b/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/CataloguePresenter.java
index 0c5f059cf..85dca61aa 100644
--- a/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/CataloguePresenter.java
+++ b/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/CataloguePresenter.java
@@ -9,10 +9,10 @@ import java.util.concurrent.TimeUnit;
import javax.inject.Inject;
-import eu.kanade.mangafeed.data.helpers.DatabaseHelper;
-import eu.kanade.mangafeed.data.helpers.SourceManager;
-import eu.kanade.mangafeed.data.models.Manga;
-import eu.kanade.mangafeed.sources.base.Source;
+import eu.kanade.mangafeed.data.database.DatabaseHelper;
+import eu.kanade.mangafeed.data.source.SourceManager;
+import eu.kanade.mangafeed.data.database.models.Manga;
+import eu.kanade.mangafeed.data.source.base.Source;
import eu.kanade.mangafeed.ui.base.presenter.BasePresenter;
import eu.kanade.mangafeed.util.PageBundle;
import eu.kanade.mangafeed.util.RxPager;
diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/SourceFragment.java b/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/SourceFragment.java
index 2c96fab89..bb74851cb 100644
--- a/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/SourceFragment.java
+++ b/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/SourceFragment.java
@@ -13,7 +13,7 @@ import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnItemClick;
import eu.kanade.mangafeed.R;
-import eu.kanade.mangafeed.sources.base.Source;
+import eu.kanade.mangafeed.data.source.base.Source;
import eu.kanade.mangafeed.ui.main.MainActivity;
import eu.kanade.mangafeed.ui.base.fragment.BaseRxFragment;
import nucleus.factory.RequiresPresenter;
diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/SourceHolder.java b/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/SourceHolder.java
index 671242c3f..7db940156 100644
--- a/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/SourceHolder.java
+++ b/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/SourceHolder.java
@@ -4,7 +4,7 @@ import android.view.View;
import android.widget.TextView;
import eu.kanade.mangafeed.R;
-import eu.kanade.mangafeed.sources.base.Source;
+import eu.kanade.mangafeed.data.source.base.Source;
import uk.co.ribot.easyadapter.ItemViewHolder;
import uk.co.ribot.easyadapter.PositionInfo;
import uk.co.ribot.easyadapter.annotations.LayoutId;
diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/SourcePresenter.java b/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/SourcePresenter.java
index a1bad5cc5..8a32a5a6e 100644
--- a/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/SourcePresenter.java
+++ b/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/SourcePresenter.java
@@ -2,9 +2,9 @@ package eu.kanade.mangafeed.ui.catalogue;
import javax.inject.Inject;
-import eu.kanade.mangafeed.data.helpers.PreferencesHelper;
-import eu.kanade.mangafeed.data.helpers.SourceManager;
-import eu.kanade.mangafeed.sources.base.Source;
+import eu.kanade.mangafeed.data.preference.PreferencesHelper;
+import eu.kanade.mangafeed.data.source.SourceManager;
+import eu.kanade.mangafeed.data.source.base.Source;
import eu.kanade.mangafeed.ui.base.presenter.BasePresenter;
diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/download/DownloadAdapter.java b/app/src/main/java/eu/kanade/mangafeed/ui/download/DownloadAdapter.java
index f5116d242..25d021a2e 100644
--- a/app/src/main/java/eu/kanade/mangafeed/ui/download/DownloadAdapter.java
+++ b/app/src/main/java/eu/kanade/mangafeed/ui/download/DownloadAdapter.java
@@ -2,7 +2,7 @@ package eu.kanade.mangafeed.ui.download;
import android.content.Context;
-import eu.kanade.mangafeed.data.models.Download;
+import eu.kanade.mangafeed.data.download.model.Download;
import uk.co.ribot.easyadapter.EasyRecyclerAdapter;
public class DownloadAdapter extends EasyRecyclerAdapter {
diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/download/DownloadFragment.java b/app/src/main/java/eu/kanade/mangafeed/ui/download/DownloadFragment.java
index 736cb2590..8cd6054e9 100644
--- a/app/src/main/java/eu/kanade/mangafeed/ui/download/DownloadFragment.java
+++ b/app/src/main/java/eu/kanade/mangafeed/ui/download/DownloadFragment.java
@@ -14,7 +14,7 @@ import java.util.List;
import butterknife.Bind;
import butterknife.ButterKnife;
import eu.kanade.mangafeed.R;
-import eu.kanade.mangafeed.data.models.Download;
+import eu.kanade.mangafeed.data.download.model.Download;
import eu.kanade.mangafeed.ui.base.fragment.BaseRxFragment;
import nucleus.factory.RequiresPresenter;
diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/download/DownloadHolder.java b/app/src/main/java/eu/kanade/mangafeed/ui/download/DownloadHolder.java
index 94526c0f6..2e3201bda 100644
--- a/app/src/main/java/eu/kanade/mangafeed/ui/download/DownloadHolder.java
+++ b/app/src/main/java/eu/kanade/mangafeed/ui/download/DownloadHolder.java
@@ -5,7 +5,7 @@ import android.widget.ProgressBar;
import android.widget.TextView;
import eu.kanade.mangafeed.R;
-import eu.kanade.mangafeed.data.models.Download;
+import eu.kanade.mangafeed.data.download.model.Download;
import uk.co.ribot.easyadapter.ItemViewHolder;
import uk.co.ribot.easyadapter.PositionInfo;
import uk.co.ribot.easyadapter.annotations.LayoutId;
diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/download/DownloadPresenter.java b/app/src/main/java/eu/kanade/mangafeed/ui/download/DownloadPresenter.java
index 8dd19aaa4..7eb6cfe30 100644
--- a/app/src/main/java/eu/kanade/mangafeed/ui/download/DownloadPresenter.java
+++ b/app/src/main/java/eu/kanade/mangafeed/ui/download/DownloadPresenter.java
@@ -7,10 +7,10 @@ import java.util.concurrent.TimeUnit;
import javax.inject.Inject;
-import eu.kanade.mangafeed.data.helpers.DownloadManager;
-import eu.kanade.mangafeed.data.models.Download;
-import eu.kanade.mangafeed.data.models.DownloadQueue;
-import eu.kanade.mangafeed.data.models.Page;
+import eu.kanade.mangafeed.data.download.DownloadManager;
+import eu.kanade.mangafeed.data.download.model.Download;
+import eu.kanade.mangafeed.data.download.model.DownloadQueue;
+import eu.kanade.mangafeed.data.source.model.Page;
import eu.kanade.mangafeed.ui.base.presenter.BasePresenter;
import rx.Observable;
import rx.Subscription;
diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/library/LibraryAdapter.java b/app/src/main/java/eu/kanade/mangafeed/ui/library/LibraryAdapter.java
index 7338340ca..a8eaa9907 100644
--- a/app/src/main/java/eu/kanade/mangafeed/ui/library/LibraryAdapter.java
+++ b/app/src/main/java/eu/kanade/mangafeed/ui/library/LibraryAdapter.java
@@ -6,8 +6,7 @@ import android.widget.Filterable;
import java.util.List;
-import eu.kanade.mangafeed.data.models.Manga;
-import eu.kanade.mangafeed.ui.library.LibraryHolder;
+import eu.kanade.mangafeed.data.database.models.Manga;
import rx.Observable;
import uk.co.ribot.easyadapter.EasyAdapter;
diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/library/LibraryFragment.java b/app/src/main/java/eu/kanade/mangafeed/ui/library/LibraryFragment.java
index 67e38db55..e5d919192 100644
--- a/app/src/main/java/eu/kanade/mangafeed/ui/library/LibraryFragment.java
+++ b/app/src/main/java/eu/kanade/mangafeed/ui/library/LibraryFragment.java
@@ -18,8 +18,8 @@ import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnItemClick;
import eu.kanade.mangafeed.R;
-import eu.kanade.mangafeed.data.models.Manga;
-import eu.kanade.mangafeed.data.services.LibraryUpdateService;
+import eu.kanade.mangafeed.data.database.models.Manga;
+import eu.kanade.mangafeed.data.sync.LibraryUpdateService;
import eu.kanade.mangafeed.ui.manga.MangaActivity;
import eu.kanade.mangafeed.ui.base.fragment.BaseRxFragment;
import nucleus.factory.RequiresPresenter;
diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/library/LibraryHolder.java b/app/src/main/java/eu/kanade/mangafeed/ui/library/LibraryHolder.java
index 5fac134d6..adff27b12 100644
--- a/app/src/main/java/eu/kanade/mangafeed/ui/library/LibraryHolder.java
+++ b/app/src/main/java/eu/kanade/mangafeed/ui/library/LibraryHolder.java
@@ -8,7 +8,7 @@ import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import eu.kanade.mangafeed.R;
-import eu.kanade.mangafeed.data.models.Manga;
+import eu.kanade.mangafeed.data.database.models.Manga;
import uk.co.ribot.easyadapter.ItemViewHolder;
import uk.co.ribot.easyadapter.PositionInfo;
import uk.co.ribot.easyadapter.annotations.LayoutId;
diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/library/LibraryPresenter.java b/app/src/main/java/eu/kanade/mangafeed/ui/library/LibraryPresenter.java
index fc9a13a2f..2cdac77e4 100644
--- a/app/src/main/java/eu/kanade/mangafeed/ui/library/LibraryPresenter.java
+++ b/app/src/main/java/eu/kanade/mangafeed/ui/library/LibraryPresenter.java
@@ -5,8 +5,8 @@ import android.util.SparseBooleanArray;
import javax.inject.Inject;
-import eu.kanade.mangafeed.data.helpers.DatabaseHelper;
-import eu.kanade.mangafeed.data.helpers.PreferencesHelper;
+import eu.kanade.mangafeed.data.database.DatabaseHelper;
+import eu.kanade.mangafeed.data.preference.PreferencesHelper;
import eu.kanade.mangafeed.ui.base.presenter.BasePresenter;
import rx.Observable;
import rx.Subscription;
diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/main/MainActivity.java b/app/src/main/java/eu/kanade/mangafeed/ui/main/MainActivity.java
index 66fea77bd..1344bc90b 100644
--- a/app/src/main/java/eu/kanade/mangafeed/ui/main/MainActivity.java
+++ b/app/src/main/java/eu/kanade/mangafeed/ui/main/MainActivity.java
@@ -14,7 +14,7 @@ import com.mikepenz.materialdrawer.model.PrimaryDrawerItem;
import butterknife.Bind;
import butterknife.ButterKnife;
import eu.kanade.mangafeed.R;
-import eu.kanade.mangafeed.ui.preference.SettingsActivity;
+import eu.kanade.mangafeed.ui.setting.SettingsActivity;
import eu.kanade.mangafeed.ui.base.activity.BaseActivity;
import eu.kanade.mangafeed.ui.download.DownloadFragment;
import eu.kanade.mangafeed.ui.library.LibraryFragment;
diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/manga/MangaActivity.java b/app/src/main/java/eu/kanade/mangafeed/ui/manga/MangaActivity.java
index e025018b7..0bad49da5 100644
--- a/app/src/main/java/eu/kanade/mangafeed/ui/manga/MangaActivity.java
+++ b/app/src/main/java/eu/kanade/mangafeed/ui/manga/MangaActivity.java
@@ -15,7 +15,7 @@ import android.view.MenuItem;
import butterknife.Bind;
import butterknife.ButterKnife;
import eu.kanade.mangafeed.R;
-import eu.kanade.mangafeed.data.models.Manga;
+import eu.kanade.mangafeed.data.database.models.Manga;
import eu.kanade.mangafeed.ui.base.activity.BaseRxActivity;
import eu.kanade.mangafeed.ui.manga.chapter.ChaptersFragment;
import eu.kanade.mangafeed.ui.manga.info.MangaInfoFragment;
diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/manga/MangaPresenter.java b/app/src/main/java/eu/kanade/mangafeed/ui/manga/MangaPresenter.java
index b7f8c5343..e1f8cbdcb 100644
--- a/app/src/main/java/eu/kanade/mangafeed/ui/manga/MangaPresenter.java
+++ b/app/src/main/java/eu/kanade/mangafeed/ui/manga/MangaPresenter.java
@@ -5,8 +5,8 @@ import android.os.Bundle;
import javax.inject.Inject;
import de.greenrobot.event.EventBus;
-import eu.kanade.mangafeed.data.helpers.DatabaseHelper;
-import eu.kanade.mangafeed.data.models.Manga;
+import eu.kanade.mangafeed.data.database.DatabaseHelper;
+import eu.kanade.mangafeed.data.database.models.Manga;
import eu.kanade.mangafeed.ui.base.presenter.BasePresenter;
import rx.Observable;
import rx.android.schedulers.AndroidSchedulers;
diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/manga/chapter/ChaptersAdapter.java b/app/src/main/java/eu/kanade/mangafeed/ui/manga/chapter/ChaptersAdapter.java
index 4c5026882..a08cabaaa 100644
--- a/app/src/main/java/eu/kanade/mangafeed/ui/manga/chapter/ChaptersAdapter.java
+++ b/app/src/main/java/eu/kanade/mangafeed/ui/manga/chapter/ChaptersAdapter.java
@@ -9,7 +9,7 @@ import java.util.List;
import eu.davidea.flexibleadapter.FlexibleAdapter;
import eu.kanade.mangafeed.R;
-import eu.kanade.mangafeed.data.models.Chapter;
+import eu.kanade.mangafeed.data.database.models.Chapter;
import eu.kanade.mangafeed.ui.base.fragment.BaseFragment;
public class ChaptersAdapter extends FlexibleAdapter {
diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/manga/chapter/ChaptersFragment.java b/app/src/main/java/eu/kanade/mangafeed/ui/manga/chapter/ChaptersFragment.java
index 347928f0e..258934053 100644
--- a/app/src/main/java/eu/kanade/mangafeed/ui/manga/chapter/ChaptersFragment.java
+++ b/app/src/main/java/eu/kanade/mangafeed/ui/manga/chapter/ChaptersFragment.java
@@ -18,8 +18,8 @@ import java.util.List;
import butterknife.Bind;
import butterknife.ButterKnife;
import eu.kanade.mangafeed.R;
-import eu.kanade.mangafeed.data.models.Chapter;
-import eu.kanade.mangafeed.data.services.DownloadService;
+import eu.kanade.mangafeed.data.database.models.Chapter;
+import eu.kanade.mangafeed.data.download.DownloadService;
import eu.kanade.mangafeed.ui.manga.MangaActivity;
import eu.kanade.mangafeed.ui.reader.ReaderActivity;
import eu.kanade.mangafeed.ui.base.activity.BaseActivity;
diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/manga/chapter/ChaptersHolder.java b/app/src/main/java/eu/kanade/mangafeed/ui/manga/chapter/ChaptersHolder.java
index d52b98b5e..31657780d 100644
--- a/app/src/main/java/eu/kanade/mangafeed/ui/manga/chapter/ChaptersHolder.java
+++ b/app/src/main/java/eu/kanade/mangafeed/ui/manga/chapter/ChaptersHolder.java
@@ -11,8 +11,7 @@ import android.widget.TextView;
import butterknife.Bind;
import butterknife.ButterKnife;
import eu.kanade.mangafeed.R;
-import eu.kanade.mangafeed.data.models.Chapter;
-import eu.kanade.mangafeed.ui.manga.chapter.ChaptersAdapter;
+import eu.kanade.mangafeed.data.database.models.Chapter;
public class ChaptersHolder extends RecyclerView.ViewHolder implements
View.OnClickListener, View.OnLongClickListener {
diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/manga/chapter/ChaptersPresenter.java b/app/src/main/java/eu/kanade/mangafeed/ui/manga/chapter/ChaptersPresenter.java
index 2e4d51dab..9dd406e82 100644
--- a/app/src/main/java/eu/kanade/mangafeed/ui/manga/chapter/ChaptersPresenter.java
+++ b/app/src/main/java/eu/kanade/mangafeed/ui/manga/chapter/ChaptersPresenter.java
@@ -8,16 +8,16 @@ import java.util.List;
import javax.inject.Inject;
import de.greenrobot.event.EventBus;
-import eu.kanade.mangafeed.data.helpers.DatabaseHelper;
-import eu.kanade.mangafeed.data.helpers.DownloadManager;
-import eu.kanade.mangafeed.data.helpers.PreferencesHelper;
-import eu.kanade.mangafeed.data.helpers.SourceManager;
-import eu.kanade.mangafeed.data.models.Chapter;
-import eu.kanade.mangafeed.data.models.Manga;
-import eu.kanade.mangafeed.events.ChapterCountEvent;
-import eu.kanade.mangafeed.events.DownloadChaptersEvent;
-import eu.kanade.mangafeed.events.SourceMangaChapterEvent;
-import eu.kanade.mangafeed.sources.base.Source;
+import eu.kanade.mangafeed.data.database.DatabaseHelper;
+import eu.kanade.mangafeed.data.download.DownloadManager;
+import eu.kanade.mangafeed.data.preference.PreferencesHelper;
+import eu.kanade.mangafeed.data.source.SourceManager;
+import eu.kanade.mangafeed.data.database.models.Chapter;
+import eu.kanade.mangafeed.data.database.models.Manga;
+import eu.kanade.mangafeed.event.ChapterCountEvent;
+import eu.kanade.mangafeed.event.DownloadChaptersEvent;
+import eu.kanade.mangafeed.event.SourceMangaChapterEvent;
+import eu.kanade.mangafeed.data.source.base.Source;
import eu.kanade.mangafeed.ui.base.presenter.BasePresenter;
import eu.kanade.mangafeed.util.EventBusHook;
import eu.kanade.mangafeed.util.PostResult;
diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/manga/info/MangaInfoFragment.java b/app/src/main/java/eu/kanade/mangafeed/ui/manga/info/MangaInfoFragment.java
index d807331d8..72a985c42 100644
--- a/app/src/main/java/eu/kanade/mangafeed/ui/manga/info/MangaInfoFragment.java
+++ b/app/src/main/java/eu/kanade/mangafeed/ui/manga/info/MangaInfoFragment.java
@@ -16,7 +16,7 @@ import com.bumptech.glide.load.engine.DiskCacheStrategy;
import butterknife.Bind;
import butterknife.ButterKnife;
import eu.kanade.mangafeed.R;
-import eu.kanade.mangafeed.data.models.Manga;
+import eu.kanade.mangafeed.data.database.models.Manga;
import eu.kanade.mangafeed.ui.base.fragment.BaseRxFragment;
import nucleus.factory.RequiresPresenter;
diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/manga/info/MangaInfoPresenter.java b/app/src/main/java/eu/kanade/mangafeed/ui/manga/info/MangaInfoPresenter.java
index 35288e2ca..b4d9c2e00 100644
--- a/app/src/main/java/eu/kanade/mangafeed/ui/manga/info/MangaInfoPresenter.java
+++ b/app/src/main/java/eu/kanade/mangafeed/ui/manga/info/MangaInfoPresenter.java
@@ -4,9 +4,9 @@ import android.os.Bundle;
import javax.inject.Inject;
-import eu.kanade.mangafeed.data.helpers.DatabaseHelper;
-import eu.kanade.mangafeed.data.models.Manga;
-import eu.kanade.mangafeed.events.ChapterCountEvent;
+import eu.kanade.mangafeed.data.database.DatabaseHelper;
+import eu.kanade.mangafeed.data.database.models.Manga;
+import eu.kanade.mangafeed.event.ChapterCountEvent;
import eu.kanade.mangafeed.ui.base.presenter.BasePresenter;
import eu.kanade.mangafeed.util.EventBusHook;
import rx.Observable;
diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/reader/ReaderActivity.java b/app/src/main/java/eu/kanade/mangafeed/ui/reader/ReaderActivity.java
index 04d5d77e8..2e776f12b 100644
--- a/app/src/main/java/eu/kanade/mangafeed/ui/reader/ReaderActivity.java
+++ b/app/src/main/java/eu/kanade/mangafeed/ui/reader/ReaderActivity.java
@@ -18,8 +18,8 @@ import butterknife.Bind;
import butterknife.ButterKnife;
import eu.kanade.mangafeed.App;
import eu.kanade.mangafeed.R;
-import eu.kanade.mangafeed.data.helpers.PreferencesHelper;
-import eu.kanade.mangafeed.data.models.Page;
+import eu.kanade.mangafeed.data.preference.PreferencesHelper;
+import eu.kanade.mangafeed.data.source.model.Page;
import eu.kanade.mangafeed.ui.base.activity.BaseRxActivity;
import eu.kanade.mangafeed.ui.reader.viewer.base.BaseReader;
import eu.kanade.mangafeed.ui.reader.viewer.horizontal.LeftToRightReader;
diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/reader/ReaderPresenter.java b/app/src/main/java/eu/kanade/mangafeed/ui/reader/ReaderPresenter.java
index 1a88a78a0..62ea34f4d 100644
--- a/app/src/main/java/eu/kanade/mangafeed/ui/reader/ReaderPresenter.java
+++ b/app/src/main/java/eu/kanade/mangafeed/ui/reader/ReaderPresenter.java
@@ -8,14 +8,14 @@ import java.util.List;
import javax.inject.Inject;
import de.greenrobot.event.EventBus;
-import eu.kanade.mangafeed.data.helpers.DatabaseHelper;
-import eu.kanade.mangafeed.data.helpers.DownloadManager;
-import eu.kanade.mangafeed.data.helpers.PreferencesHelper;
-import eu.kanade.mangafeed.data.models.Chapter;
-import eu.kanade.mangafeed.data.models.Manga;
-import eu.kanade.mangafeed.data.models.Page;
-import eu.kanade.mangafeed.events.SourceMangaChapterEvent;
-import eu.kanade.mangafeed.sources.base.Source;
+import eu.kanade.mangafeed.data.database.DatabaseHelper;
+import eu.kanade.mangafeed.data.download.DownloadManager;
+import eu.kanade.mangafeed.data.preference.PreferencesHelper;
+import eu.kanade.mangafeed.data.database.models.Chapter;
+import eu.kanade.mangafeed.data.database.models.Manga;
+import eu.kanade.mangafeed.data.source.model.Page;
+import eu.kanade.mangafeed.event.SourceMangaChapterEvent;
+import eu.kanade.mangafeed.data.source.base.Source;
import eu.kanade.mangafeed.ui.base.presenter.BasePresenter;
import eu.kanade.mangafeed.util.EventBusHook;
import icepick.State;
diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/base/BaseReader.java b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/base/BaseReader.java
index 4670e8056..fb0d07af4 100644
--- a/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/base/BaseReader.java
+++ b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/base/BaseReader.java
@@ -5,7 +5,7 @@ import android.widget.FrameLayout;
import java.util.List;
-import eu.kanade.mangafeed.data.models.Page;
+import eu.kanade.mangafeed.data.source.model.Page;
import eu.kanade.mangafeed.ui.reader.ReaderActivity;
public abstract class BaseReader {
diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/common/ViewPagerReaderAdapter.java b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/common/ViewPagerReaderAdapter.java
index a2c5e7ee6..9d4d2d3fe 100644
--- a/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/common/ViewPagerReaderAdapter.java
+++ b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/common/ViewPagerReaderAdapter.java
@@ -5,7 +5,7 @@ import android.support.v4.app.FragmentManager;
import java.util.List;
-import eu.kanade.mangafeed.data.models.Page;
+import eu.kanade.mangafeed.data.source.model.Page;
public class ViewPagerReaderAdapter extends SmartFragmentStatePagerAdapter {
diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/common/ViewPagerReaderFragment.java b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/common/ViewPagerReaderFragment.java
index abbb6c185..aac1636ce 100644
--- a/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/common/ViewPagerReaderFragment.java
+++ b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/common/ViewPagerReaderFragment.java
@@ -18,7 +18,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import butterknife.Bind;
import butterknife.ButterKnife;
import eu.kanade.mangafeed.R;
-import eu.kanade.mangafeed.data.models.Page;
+import eu.kanade.mangafeed.data.source.model.Page;
import eu.kanade.mangafeed.ui.base.fragment.BaseFragment;
import eu.kanade.mangafeed.ui.reader.ReaderActivity;
import rx.Observable;
diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/horizontal/HorizontalReader.java b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/horizontal/HorizontalReader.java
index 908fac845..aac13c961 100644
--- a/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/horizontal/HorizontalReader.java
+++ b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/horizontal/HorizontalReader.java
@@ -8,7 +8,7 @@ import java.util.List;
import butterknife.Bind;
import butterknife.ButterKnife;
import eu.kanade.mangafeed.R;
-import eu.kanade.mangafeed.data.models.Page;
+import eu.kanade.mangafeed.data.source.model.Page;
import eu.kanade.mangafeed.ui.reader.ReaderActivity;
import eu.kanade.mangafeed.ui.reader.viewer.base.BaseReader;
import eu.kanade.mangafeed.ui.reader.viewer.common.ViewPagerReaderAdapter;
diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/horizontal/RightToLeftReader.java b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/horizontal/RightToLeftReader.java
index 3717e0d5e..6a4958be9 100644
--- a/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/horizontal/RightToLeftReader.java
+++ b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/horizontal/RightToLeftReader.java
@@ -6,7 +6,7 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
-import eu.kanade.mangafeed.data.models.Page;
+import eu.kanade.mangafeed.data.source.model.Page;
import eu.kanade.mangafeed.ui.reader.ReaderActivity;
public class RightToLeftReader extends HorizontalReader {
@@ -20,7 +20,7 @@ public class RightToLeftReader extends HorizontalReader {
ArrayList inversedPages = new ArrayList<>(pages);
Collections.reverse(inversedPages);
adapter.setPages(inversedPages);
- viewPager.setCurrentItem(adapter.getCount()-1, false);
+ viewPager.setCurrentItem(adapter.getCount() - 1, false);
}
@Override
diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/vertical/VerticalReader.java b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/vertical/VerticalReader.java
index c176014d7..a4969ad4e 100644
--- a/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/vertical/VerticalReader.java
+++ b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/vertical/VerticalReader.java
@@ -9,7 +9,7 @@ import java.util.List;
import butterknife.Bind;
import butterknife.ButterKnife;
import eu.kanade.mangafeed.R;
-import eu.kanade.mangafeed.data.models.Page;
+import eu.kanade.mangafeed.data.source.model.Page;
import eu.kanade.mangafeed.ui.reader.ReaderActivity;
import eu.kanade.mangafeed.ui.reader.viewer.base.BaseReader;
import eu.kanade.mangafeed.ui.reader.viewer.common.ViewPagerReaderAdapter;
diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/webtoon/WebtoonAdapter.java b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/webtoon/WebtoonAdapter.java
index 5e0894922..4f5dee4b9 100644
--- a/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/webtoon/WebtoonAdapter.java
+++ b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/webtoon/WebtoonAdapter.java
@@ -11,7 +11,7 @@ import java.util.ArrayList;
import java.util.List;
import eu.kanade.mangafeed.R;
-import eu.kanade.mangafeed.data.models.Page;
+import eu.kanade.mangafeed.data.source.model.Page;
import uk.co.ribot.easyadapter.BaseEasyRecyclerAdapter;
import uk.co.ribot.easyadapter.ItemViewHolder;
import uk.co.ribot.easyadapter.PositionInfo;
diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/webtoon/WebtoonReader.java b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/webtoon/WebtoonReader.java
index f9e0d75cc..9329b6e0f 100644
--- a/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/webtoon/WebtoonReader.java
+++ b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/webtoon/WebtoonReader.java
@@ -7,7 +7,7 @@ import android.widget.FrameLayout;
import java.util.List;
-import eu.kanade.mangafeed.data.models.Page;
+import eu.kanade.mangafeed.data.source.model.Page;
import eu.kanade.mangafeed.ui.reader.ReaderActivity;
import eu.kanade.mangafeed.ui.reader.viewer.base.BaseReader;
import rx.Subscription;
diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/preference/LoginDialogPreference.java b/app/src/main/java/eu/kanade/mangafeed/ui/setting/LoginDialogPreference.java
similarity index 96%
rename from app/src/main/java/eu/kanade/mangafeed/ui/preference/LoginDialogPreference.java
rename to app/src/main/java/eu/kanade/mangafeed/ui/setting/LoginDialogPreference.java
index ca9660ff0..dfbfc07ff 100644
--- a/app/src/main/java/eu/kanade/mangafeed/ui/preference/LoginDialogPreference.java
+++ b/app/src/main/java/eu/kanade/mangafeed/ui/setting/LoginDialogPreference.java
@@ -1,4 +1,4 @@
-package eu.kanade.mangafeed.ui.preference;
+package eu.kanade.mangafeed.ui.setting;
import android.app.AlertDialog;
import android.content.Context;
@@ -16,8 +16,8 @@ import com.dd.processbutton.iml.ActionProcessButton;
import butterknife.Bind;
import butterknife.ButterKnife;
import eu.kanade.mangafeed.R;
-import eu.kanade.mangafeed.data.helpers.PreferencesHelper;
-import eu.kanade.mangafeed.sources.base.Source;
+import eu.kanade.mangafeed.data.preference.PreferencesHelper;
+import eu.kanade.mangafeed.data.source.base.Source;
import eu.kanade.mangafeed.util.ToastUtil;
import rx.Subscription;
import rx.android.schedulers.AndroidSchedulers;
diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/preference/SettingsAccountsFragment.java b/app/src/main/java/eu/kanade/mangafeed/ui/setting/SettingsAccountsFragment.java
similarity index 88%
rename from app/src/main/java/eu/kanade/mangafeed/ui/preference/SettingsAccountsFragment.java
rename to app/src/main/java/eu/kanade/mangafeed/ui/setting/SettingsAccountsFragment.java
index 0c6dc9fea..95cec0106 100644
--- a/app/src/main/java/eu/kanade/mangafeed/ui/preference/SettingsAccountsFragment.java
+++ b/app/src/main/java/eu/kanade/mangafeed/ui/setting/SettingsAccountsFragment.java
@@ -1,4 +1,4 @@
-package eu.kanade.mangafeed.ui.preference;
+package eu.kanade.mangafeed.ui.setting;
import android.os.Bundle;
import android.preference.PreferenceFragment;
@@ -10,9 +10,9 @@ import javax.inject.Inject;
import eu.kanade.mangafeed.App;
import eu.kanade.mangafeed.R;
-import eu.kanade.mangafeed.data.helpers.PreferencesHelper;
-import eu.kanade.mangafeed.data.helpers.SourceManager;
-import eu.kanade.mangafeed.sources.base.Source;
+import eu.kanade.mangafeed.data.preference.PreferencesHelper;
+import eu.kanade.mangafeed.data.source.SourceManager;
+import eu.kanade.mangafeed.data.source.base.Source;
import eu.kanade.mangafeed.ui.base.activity.BaseActivity;
import rx.Observable;
diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/preference/SettingsActivity.java b/app/src/main/java/eu/kanade/mangafeed/ui/setting/SettingsActivity.java
similarity index 96%
rename from app/src/main/java/eu/kanade/mangafeed/ui/preference/SettingsActivity.java
rename to app/src/main/java/eu/kanade/mangafeed/ui/setting/SettingsActivity.java
index f5b96e817..becf45c76 100644
--- a/app/src/main/java/eu/kanade/mangafeed/ui/preference/SettingsActivity.java
+++ b/app/src/main/java/eu/kanade/mangafeed/ui/setting/SettingsActivity.java
@@ -1,4 +1,4 @@
-package eu.kanade.mangafeed.ui.preference;
+package eu.kanade.mangafeed.ui.setting;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/preference/SettingsDownloadsFragment.java b/app/src/main/java/eu/kanade/mangafeed/ui/setting/SettingsDownloadsFragment.java
similarity index 94%
rename from app/src/main/java/eu/kanade/mangafeed/ui/preference/SettingsDownloadsFragment.java
rename to app/src/main/java/eu/kanade/mangafeed/ui/setting/SettingsDownloadsFragment.java
index 56d53752c..cd0f024cf 100644
--- a/app/src/main/java/eu/kanade/mangafeed/ui/preference/SettingsDownloadsFragment.java
+++ b/app/src/main/java/eu/kanade/mangafeed/ui/setting/SettingsDownloadsFragment.java
@@ -1,4 +1,4 @@
-package eu.kanade.mangafeed.ui.preference;
+package eu.kanade.mangafeed.ui.setting;
import android.os.Bundle;
import android.preference.ListPreference;
@@ -9,7 +9,7 @@ import javax.inject.Inject;
import eu.kanade.mangafeed.App;
import eu.kanade.mangafeed.R;
-import eu.kanade.mangafeed.data.helpers.PreferencesHelper;
+import eu.kanade.mangafeed.data.preference.PreferencesHelper;
import eu.kanade.mangafeed.ui.base.activity.BaseActivity;
import eu.kanade.mangafeed.util.DiskUtils;
diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/preference/SettingsMainFragment.java b/app/src/main/java/eu/kanade/mangafeed/ui/setting/SettingsMainFragment.java
similarity index 97%
rename from app/src/main/java/eu/kanade/mangafeed/ui/preference/SettingsMainFragment.java
rename to app/src/main/java/eu/kanade/mangafeed/ui/setting/SettingsMainFragment.java
index 08333361d..dbc92a607 100644
--- a/app/src/main/java/eu/kanade/mangafeed/ui/preference/SettingsMainFragment.java
+++ b/app/src/main/java/eu/kanade/mangafeed/ui/setting/SettingsMainFragment.java
@@ -1,4 +1,4 @@
-package eu.kanade.mangafeed.ui.preference;
+package eu.kanade.mangafeed.ui.setting;
import android.os.Bundle;
import android.preference.PreferenceFragment;
diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/preference/SettingsNestedFragment.java b/app/src/main/java/eu/kanade/mangafeed/ui/setting/SettingsNestedFragment.java
similarity index 96%
rename from app/src/main/java/eu/kanade/mangafeed/ui/preference/SettingsNestedFragment.java
rename to app/src/main/java/eu/kanade/mangafeed/ui/setting/SettingsNestedFragment.java
index 8f429f572..4a8209be7 100644
--- a/app/src/main/java/eu/kanade/mangafeed/ui/preference/SettingsNestedFragment.java
+++ b/app/src/main/java/eu/kanade/mangafeed/ui/setting/SettingsNestedFragment.java
@@ -1,4 +1,4 @@
-package eu.kanade.mangafeed.ui.preference;
+package eu.kanade.mangafeed.ui.setting;
import android.os.Bundle;
import android.preference.PreferenceFragment;
diff --git a/app/src/main/java/eu/kanade/mangafeed/util/ChapterRecognition.java b/app/src/main/java/eu/kanade/mangafeed/util/ChapterRecognition.java
index ecc7c468f..4ae12d3a5 100644
--- a/app/src/main/java/eu/kanade/mangafeed/util/ChapterRecognition.java
+++ b/app/src/main/java/eu/kanade/mangafeed/util/ChapterRecognition.java
@@ -5,8 +5,8 @@ import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import eu.kanade.mangafeed.data.models.Chapter;
-import eu.kanade.mangafeed.data.models.Manga;
+import eu.kanade.mangafeed.data.database.models.Chapter;
+import eu.kanade.mangafeed.data.database.models.Manga;
public class ChapterRecognition {
diff --git a/app/src/test/java/eu/kanade/mangafeed/ChapterRecognitionTest.java b/app/src/test/java/eu/kanade/mangafeed/ChapterRecognitionTest.java
index 165f8072d..c2803c7e3 100644
--- a/app/src/test/java/eu/kanade/mangafeed/ChapterRecognitionTest.java
+++ b/app/src/test/java/eu/kanade/mangafeed/ChapterRecognitionTest.java
@@ -3,8 +3,8 @@ package eu.kanade.mangafeed;
import org.junit.Before;
import org.junit.Test;
-import eu.kanade.mangafeed.data.models.Chapter;
-import eu.kanade.mangafeed.data.models.Manga;
+import eu.kanade.mangafeed.data.database.models.Chapter;
+import eu.kanade.mangafeed.data.database.models.Manga;
import eu.kanade.mangafeed.util.ChapterRecognition;
import static org.hamcrest.Matchers.is;