Rewrote Backup (#650)

* Rewrote Backup

* Save automatic backups with datetime

* Minor improvements

* Remove suggested directories for backup and hardcoded strings. Rename JSON -> Backup

* Bugfix

* Fix tests

* Run restore inside a transaction, use external cache dir for log and other minor changes
This commit is contained in:
Bram van de Kerkhof
2017-04-04 17:42:17 +02:00
committed by inorichi
parent 3094d084d6
commit 0642889b64
39 changed files with 2166 additions and 1149 deletions

View File

@@ -48,6 +48,14 @@
<item>3</item>
</string-array>
<string-array name="backup_slots">
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
</string-array>
<string-array name="remove_after_read_slots">
<item>@string/disabled</item>
<item>@string/last_read_chapter</item>
@@ -146,6 +154,24 @@
<item>48</item>
</string-array>
<string-array name="backup_update_interval">
<item>@string/update_never</item>
<item>@string/update_6hour</item>
<item>@string/update_12hour</item>
<item>@string/update_24hour</item>
<item>@string/update_48hour</item>
<item>@string/update_weekly</item>
</string-array>
<string-array name="backup_update_interval_values">
<item>0</item>
<item>6</item>
<item>12</item>
<item>24</item>
<item>48</item>
<item>168</item>
</string-array>
<string-array name="library_update_restrictions">
<item>@string/wifi</item>
<item>@string/charging</item>
@@ -188,6 +214,22 @@
<item>2</item>
</string-array>
<string-array name="backup_options">
<item>@string/manga</item>
<item>@string/categories</item>
<item>@string/chapters</item>
<item>@string/track</item>
<item>@string/history</item>
</string-array>
<string-array name="backup_options_values">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
</string-array>
<string-array name="languages_values">
<item/> <!-- system language -->
<item>bg</item>

View File

@@ -52,6 +52,12 @@
<string name="pref_remove_after_marked_as_read_key" translatable="false">pref_remove_after_marked_as_read_key</string>
<string name="pref_last_used_category_key" translatable="false">last_used_category</string>
<string name="pref_create_local_backup_key" translatable="false">create_local_backup</string>
<string name="pref_restore_local_backup_key" translatable="false">restore_local_backup</string>
<string name="pref_backup_interval_key" translatable="false">backup_interval</string>
<string name="pref_backup_directory_key" translatable="false">backup_directory</string>
<string name="pref_backup_slots_key" translatable="false">backup_slots</string>
<string name="pref_source_languages" translatable="false">source_languages</string>
<string name="pref_category_tracking_accounts_key" translatable="false">category_tracking_accounts</string>
@@ -73,4 +79,4 @@
<!-- String Fonts -->
<string name="font_roboto_medium" translatable="false">sans-serif</string>
<string name="font_roboto_regular" translatable="false">sans-serif</string>
</resources>
</resources>

View File

@@ -1,7 +1,13 @@
<resources>
<string name="app_name" translatable="false">Tachiyomi</string>
<!--Models-->
<string name="name">Name</string>
<string name="categories">Categories</string>
<string name="manga">Manga</string>
<string name="chapters">Chapters</string>
<string name="track">Tracking</string>
<string name="history">History</string>
<!-- Activities and fragments labels (toolbar title) -->
<string name="label_settings">Settings</string>
@@ -53,11 +59,13 @@
<string name="action_stop">Stop</string>
<string name="action_pause">Pause</string>
<string name="action_clear">Clear</string>
<string name="action_close">Close</string>
<string name="action_previous_chapter">Previous chapter</string>
<string name="action_next_chapter">Next chapter</string>
<string name="action_retry">Retry</string>
<string name="action_remove">Remove</string>
<string name="action_resume">Resume</string>
<string name="action_move">Move</string>
<string name="action_open_in_browser">Open in browser</string>
<string name="action_add_to_home_screen">Add to home screen</string>
<string name="action_display_mode">Change display mode</string>
@@ -72,6 +80,10 @@
<string name="action_save">Save</string>
<string name="action_reset">Reset</string>
<string name="action_undo">Undo</string>
<string name="action_export">Export</string>
<string name="action_open_log">Open log</string>
<string name="action_create">Create</string>
<string name="action_restore">Restore</string>
<!-- Operations -->
<string name="deleting">Deleting…</string>
@@ -101,6 +113,8 @@
<string name="update_12hour">Every 12 hours</string>
<string name="update_24hour">Daily</string>
<string name="update_48hour">Every 2 days</string>
<string name="update_weekly">Weekly</string>
<string name="update_monthly">Monthly</string>
<string name="pref_library_update_categories">Categories to include in global update</string>
<string name="all">All</string>
<string name="pref_library_update_restriction">Library update restrictions</string>
@@ -181,6 +195,29 @@
<!-- Sync section -->
<string name="services">Services</string>
<!-- Backup section -->
<string name="backup">Backup</string>
<string name="pref_create_backup">Create backup</string>
<string name="pref_create_backup_summ">Can be used to restore current library</string>
<string name="pref_restore_backup">Restore backup</string>
<string name="pref_restore_backup_summ">Restore library from backup file</string>
<string name="pref_backup_directory">Backup directory</string>
<string name="pref_backup_service_category">Service</string>
<string name="pref_backup_interval">Backup frequency</string>
<string name="pref_backup_slots">Max automatic backups</string>
<string name="dialog_restoring_backup">Restoring backup\n%1$s added to library</string>
<string name="source_not_found">Source not found</string>
<string name="dialog_restoring_source_not_found">Restoring backup\n%1$s source not found</string>
<string name="backup_created">Backup created</string>
<string name="restore_completed">Restore completed</string>
<string name="error_opening_log">Could not open log</string>
<string name="restore_completed_content">Restore took %1$s.\n%2$s errors found.</string>
<string name="backup_restore_content">Restore uses source to fetch data, carrier costs may apply.\nAlso make sure you are properly logged in sources that require so before restoring.</string>
<string name="file_saved">File saved at %1$s</string>
<string name="backup_choice">What do you want to backup?</string>
<string name="restoring_backup">Restoring backup</string>
<string name="creating_backup">Creating backup</string>
<!-- Advanced section -->
<string name="pref_clear_chapter_cache">Clear chapter cache</string>
<string name="used_cache">Used: %1$s</string>
@@ -290,7 +327,6 @@
<string name="score">Score</string>
<string name="title">Title</string>
<string name="status">Status</string>
<string name="chapters">Chapters</string>
<!-- Category activity -->
<string name="error_category_exists">A category with this name already exists!</string>
@@ -324,13 +360,6 @@
<string name="confirm_set_image_as_cover">Do you want to set this image as the cover?</string>
<string name="viewer_for_this_series">Viewer for this series</string>
<!-- Backup fragment -->
<string name="backup">Backup</string>
<string name="restore">Restore</string>
<string name="backup_please_wait">Backup in progress. Please wait…</string>
<string name="backup_completed">Backup successfully restored</string>
<string name="restore_please_wait">Restoring backup. Please wait…</string>
<!-- Recent manga fragment -->
<string name="recent_manga_source">%1$s - Ch.%2$s</string>