-Updated room db to 1.1.1.
-Fixed database import/export to no longer include accessory db files to ensure backward compatibility.
This commit is contained in:
parent
fb1a290bd9
commit
27131d15dd
2 changed files with 16 additions and 4 deletions
|
@ -43,7 +43,7 @@ android {
|
||||||
ext {
|
ext {
|
||||||
supportLibVersion = '27.1.1'
|
supportLibVersion = '27.1.1'
|
||||||
exoPlayerLibVersion = '2.7.3'
|
exoPlayerLibVersion = '2.7.3'
|
||||||
roomDbLibVersion = '1.0.0'
|
roomDbLibVersion = '1.1.1'
|
||||||
leakCanaryLibVersion = '1.5.4'
|
leakCanaryLibVersion = '1.5.4'
|
||||||
okHttpLibVersion = '3.10.0'
|
okHttpLibVersion = '3.10.0'
|
||||||
icepickLibVersion = '3.2.0'
|
icepickLibVersion = '3.2.0'
|
||||||
|
|
|
@ -56,6 +56,8 @@ public class ContentSettingsFragment extends BasePreferenceFragment {
|
||||||
private File databasesDir;
|
private File databasesDir;
|
||||||
private File newpipe_db;
|
private File newpipe_db;
|
||||||
private File newpipe_db_journal;
|
private File newpipe_db_journal;
|
||||||
|
private File newpipe_db_shm;
|
||||||
|
private File newpipe_db_wal;
|
||||||
private File newpipe_settings;
|
private File newpipe_settings;
|
||||||
|
|
||||||
private String thumbnailLoadToggleKey;
|
private String thumbnailLoadToggleKey;
|
||||||
|
@ -88,6 +90,9 @@ public class ContentSettingsFragment extends BasePreferenceFragment {
|
||||||
databasesDir = new File(homeDir + "/databases");
|
databasesDir = new File(homeDir + "/databases");
|
||||||
newpipe_db = new File(homeDir + "/databases/newpipe.db");
|
newpipe_db = new File(homeDir + "/databases/newpipe.db");
|
||||||
newpipe_db_journal = new File(homeDir + "/databases/newpipe.db-journal");
|
newpipe_db_journal = new File(homeDir + "/databases/newpipe.db-journal");
|
||||||
|
newpipe_db_shm = new File(homeDir + "/databases/newpipe.db-shm");
|
||||||
|
newpipe_db_wal = new File(homeDir + "/databases/newpipe.db-wal");
|
||||||
|
|
||||||
newpipe_settings = new File(homeDir + "/databases/newpipe.settings");
|
newpipe_settings = new File(homeDir + "/databases/newpipe.settings");
|
||||||
newpipe_settings.delete();
|
newpipe_settings.delete();
|
||||||
|
|
||||||
|
@ -207,7 +212,7 @@ public class ContentSettingsFragment extends BasePreferenceFragment {
|
||||||
new BufferedOutputStream(
|
new BufferedOutputStream(
|
||||||
new FileOutputStream(path)));
|
new FileOutputStream(path)));
|
||||||
ZipHelper.addFileToZip(outZip, newpipe_db.getPath(), "newpipe.db");
|
ZipHelper.addFileToZip(outZip, newpipe_db.getPath(), "newpipe.db");
|
||||||
ZipHelper.addFileToZip(outZip, newpipe_db_journal.getPath(), "newpipe.db-journal");
|
|
||||||
saveSharedPreferencesToFile(newpipe_settings);
|
saveSharedPreferencesToFile(newpipe_settings);
|
||||||
ZipHelper.addFileToZip(outZip, newpipe_settings.getPath(), "newpipe.settings");
|
ZipHelper.addFileToZip(outZip, newpipe_settings.getPath(), "newpipe.settings");
|
||||||
|
|
||||||
|
@ -263,8 +268,15 @@ public class ContentSettingsFragment extends BasePreferenceFragment {
|
||||||
throw new Exception("Could not create databases dir");
|
throw new Exception("Could not create databases dir");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!(ZipHelper.extractFileFromZip(filePath, newpipe_db.getPath(), "newpipe.db")
|
final boolean isDbFileExtracted = ZipHelper.extractFileFromZip(filePath,
|
||||||
&& ZipHelper.extractFileFromZip(filePath, newpipe_db_journal.getPath(), "newpipe.db-journal"))) {
|
newpipe_db.getPath(), "newpipe.db");
|
||||||
|
|
||||||
|
if (isDbFileExtracted) {
|
||||||
|
newpipe_db_journal.delete();
|
||||||
|
newpipe_db_wal.delete();
|
||||||
|
newpipe_db_shm.delete();
|
||||||
|
|
||||||
|
} else {
|
||||||
Toast.makeText(getContext(), R.string.could_not_import_all_files, Toast.LENGTH_LONG)
|
Toast.makeText(getContext(), R.string.could_not_import_all_files, Toast.LENGTH_LONG)
|
||||||
.show();
|
.show();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue