File tree Expand file tree Collapse file tree 4 files changed +9
-21
lines changed
app/src/main/java/org/schabi/newpipe Expand file tree Collapse file tree 4 files changed +9
-21
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -9,13 +9,14 @@ package org.schabi.newpipe.database.history.dao
99import androidx.room.Dao
1010import androidx.room.Query
1111import io.reactivex.rxjava3.core.Flowable
12+ import org.schabi.newpipe.database.BasicDAO
1213import org.schabi.newpipe.database.history.model.SearchHistoryEntry
1314
1415@Dao
15- interface SearchHistoryDAO : HistoryDAO <SearchHistoryEntry > {
16+ interface SearchHistoryDAO : BasicDAO <SearchHistoryEntry > {
1617
1718 @get:Query(" SELECT * FROM search_history WHERE id = (SELECT MAX(id) FROM search_history)" )
18- override val latestEntry: SearchHistoryEntry
19+ val latestEntry: SearchHistoryEntry ?
1920
2021 @Query(" DELETE FROM search_history" )
2122 override fun deleteAll (): Int
Original file line number Diff line number Diff line change @@ -10,15 +10,13 @@ import androidx.room.Dao
1010import androidx.room.Query
1111import androidx.room.RewriteQueriesToDropUnusedColumns
1212import io.reactivex.rxjava3.core.Flowable
13+ import org.schabi.newpipe.database.BasicDAO
1314import org.schabi.newpipe.database.history.model.StreamHistoryEntity
1415import org.schabi.newpipe.database.history.model.StreamHistoryEntry
1516import org.schabi.newpipe.database.stream.StreamStatisticsEntry
1617
1718@Dao
18- abstract class StreamHistoryDAO : HistoryDAO <StreamHistoryEntity > {
19-
20- @get:Query(" SELECT * FROM stream_history WHERE access_date = (SELECT MAX(access_date) FROM stream_history)" )
21- abstract override val latestEntry: StreamHistoryEntity
19+ abstract class StreamHistoryDAO : BasicDAO <StreamHistoryEntity > {
2220
2321 @Query(" SELECT * FROM stream_history" )
2422 abstract override fun getAll (): Flowable <List <StreamHistoryEntity >>
Original file line number Diff line number Diff line change 4040import java .util .Date ;
4141import java .util .Locale ;
4242import java .util .Objects ;
43+ import java .util .concurrent .ExecutorService ;
44+ import java .util .concurrent .Executors ;
4345
4446public class BackupRestoreSettingsFragment extends BasePreferenceFragment {
4547
@@ -155,9 +157,9 @@ private void requestImportPathResult(final ActivityResult result) {
155157 }
156158
157159 private void exportDatabase (final StoredFileHelper file , final Uri exportDataUri ) {
158- try {
160+ try ( ExecutorService executor = Executors . newSingleThreadExecutor ()) {
159161 //checkpoint before export
160- NewPipeDatabase . checkpoint ();
162+ executor . submit ( NewPipeDatabase :: checkpoint ). get ();
161163
162164 final SharedPreferences preferences = PreferenceManager
163165 .getDefaultSharedPreferences (requireContext ());
You can’t perform that action at this time.
0 commit comments