mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-29 00:10:32 +05:30
Limit the watch history size to 100 by default
This commit is contained in:
parent
93b235abea
commit
22dce72e95
@ -26,7 +26,7 @@ object DatabaseHelper {
|
|||||||
query {
|
query {
|
||||||
Database.watchHistoryDao().insertAll(watchHistoryItem)
|
Database.watchHistoryDao().insertAll(watchHistoryItem)
|
||||||
val maxHistorySize =
|
val maxHistorySize =
|
||||||
PreferenceHelper.getString(PreferenceKeys.WATCH_HISTORY_SIZE, "unlimited")
|
PreferenceHelper.getString(PreferenceKeys.WATCH_HISTORY_SIZE, "100")
|
||||||
if (maxHistorySize == "unlimited") return@query
|
if (maxHistorySize == "unlimited") return@query
|
||||||
|
|
||||||
// delete the first watch history entry if the limit is reached
|
// delete the first watch history entry if the limit is reached
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
app:title="@string/watch_history" />
|
app:title="@string/watch_history" />
|
||||||
|
|
||||||
<ListPreference
|
<ListPreference
|
||||||
android:defaultValue="unlimited"
|
android:defaultValue="100"
|
||||||
android:entries="@array/historySize"
|
android:entries="@array/historySize"
|
||||||
android:entryValues="@array/historySizeValues"
|
android:entryValues="@array/historySizeValues"
|
||||||
android:icon="@drawable/ic_list"
|
android:icon="@drawable/ic_list"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user