Skip to content

Commit f1ff465

Browse files
committed
[feature|optimize|chore] Support skipping articles in playlist when deleting; optimize PlayerViewModel.kt; clean code
1 parent 692036f commit f1ff465

File tree

59 files changed

+803
-606
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+803
-606
lines changed

app/build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ android {
2222
minSdk = 24
2323
targetSdk = 35
2424
versionCode = 26
25-
versionName = "3.1-beta05"
25+
versionName = "3.1-beta06"
2626

2727
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
2828

app/src/androidTest/java/com/skyd/anivu/PeriodicTaskModule.kt

+5-5
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ import com.skyd.anivu.model.db.AppDatabase
2727
import com.skyd.anivu.model.db.dao.ArticleDao
2828
import com.skyd.anivu.model.db.dao.FeedDao
2929
import com.skyd.anivu.model.db.dao.GroupDao
30-
import com.skyd.anivu.model.preference.data.autodelete.AutoDeleteArticleBeforePreference
31-
import com.skyd.anivu.model.preference.data.autodelete.AutoDeleteArticleFrequencyPreference
32-
import com.skyd.anivu.model.preference.data.autodelete.AutoDeleteArticleKeepFavoritePreference
33-
import com.skyd.anivu.model.preference.data.autodelete.AutoDeleteArticleKeepUnreadPreference
34-
import com.skyd.anivu.model.preference.data.autodelete.UseAutoDeletePreference
30+
import com.skyd.anivu.model.preference.data.delete.autodelete.AutoDeleteArticleBeforePreference
31+
import com.skyd.anivu.model.preference.data.delete.autodelete.AutoDeleteArticleFrequencyPreference
32+
import com.skyd.anivu.model.preference.data.delete.autodelete.AutoDeleteArticleKeepFavoritePreference
33+
import com.skyd.anivu.model.preference.data.delete.autodelete.AutoDeleteArticleKeepUnreadPreference
34+
import com.skyd.anivu.model.preference.data.delete.autodelete.UseAutoDeletePreference
3535
import com.skyd.anivu.model.preference.rss.RssSyncFrequencyPreference
3636
import com.skyd.anivu.model.repository.RssHelper
3737
import com.skyd.anivu.model.repository.feed.FeedRepository

app/src/main/java/com/skyd/anivu/ext/PreferenceExt.kt

+10-8
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,15 @@ import com.skyd.anivu.model.preference.behavior.playlist.PlaylistMediaSortByPref
4444
import com.skyd.anivu.model.preference.behavior.playlist.PlaylistSortAscPreference
4545
import com.skyd.anivu.model.preference.behavior.playlist.PlaylistSortByPreference
4646
import com.skyd.anivu.model.preference.data.OpmlExportDirPreference
47-
import com.skyd.anivu.model.preference.data.autodelete.AutoDeleteArticleBeforePreference
48-
import com.skyd.anivu.model.preference.data.autodelete.AutoDeleteArticleFrequencyPreference
49-
import com.skyd.anivu.model.preference.data.autodelete.AutoDeleteArticleKeepFavoritePreference
50-
import com.skyd.anivu.model.preference.data.autodelete.AutoDeleteArticleKeepUnreadPreference
51-
import com.skyd.anivu.model.preference.data.autodelete.AutoDeleteArticleMaxCountPreference
52-
import com.skyd.anivu.model.preference.data.autodelete.AutoDeleteArticleUseBeforePreference
53-
import com.skyd.anivu.model.preference.data.autodelete.AutoDeleteArticleUseMaxCountPreference
54-
import com.skyd.anivu.model.preference.data.autodelete.UseAutoDeletePreference
47+
import com.skyd.anivu.model.preference.data.delete.KeepPlaylistArticlesPreference
48+
import com.skyd.anivu.model.preference.data.delete.autodelete.AutoDeleteArticleBeforePreference
49+
import com.skyd.anivu.model.preference.data.delete.autodelete.AutoDeleteArticleFrequencyPreference
50+
import com.skyd.anivu.model.preference.data.delete.autodelete.AutoDeleteArticleKeepFavoritePreference
51+
import com.skyd.anivu.model.preference.data.delete.autodelete.AutoDeleteArticleKeepUnreadPreference
52+
import com.skyd.anivu.model.preference.data.delete.autodelete.AutoDeleteArticleMaxCountPreference
53+
import com.skyd.anivu.model.preference.data.delete.autodelete.AutoDeleteArticleUseBeforePreference
54+
import com.skyd.anivu.model.preference.data.delete.autodelete.AutoDeleteArticleUseMaxCountPreference
55+
import com.skyd.anivu.model.preference.data.delete.autodelete.UseAutoDeletePreference
5556
import com.skyd.anivu.model.preference.data.medialib.MediaLibLocationPreference
5657
import com.skyd.anivu.model.preference.player.BackgroundPlayPreference
5758
import com.skyd.anivu.model.preference.player.HardwareDecodePreference
@@ -157,6 +158,7 @@ fun Preferences.toSettings(): Settings {
157158
autoDeleteArticleKeepFavorite = AutoDeleteArticleKeepFavoritePreference.fromPreferences(this),
158159
autoDeleteArticleUseMaxCount = AutoDeleteArticleUseMaxCountPreference.fromPreferences(this),
159160
autoDeleteArticleMaxCount = AutoDeleteArticleMaxCountPreference.fromPreferences(this),
161+
keepPlaylistArticles = KeepPlaylistArticlesPreference.fromPreferences(this),
160162
opmlExportDir = OpmlExportDirPreference.fromPreferences(this),
161163
mediaLibLocation = MediaLibLocationPreference.fromPreferences(this),
162164

app/src/main/java/com/skyd/anivu/ext/StringExt.kt

+3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ fun String.toRemoveHtml(): String = parseAsHtml().toString()
2222

2323
fun CharSequence.splitByBlank(limit: Int = 0): List<String> = trim().split("\\s+".toRegex(), limit)
2424

25+
fun String.firstCodePointOrNull(): String? =
26+
if (isEmpty()) null else String(Character.toChars(codePointAt(0)))
27+
2528
fun String.readable(): String =
2629
Readability4JExtended("", this).parse().textContent?.trim().orEmpty()
2730

app/src/main/java/com/skyd/anivu/model/bean/history/MediaPlayHistoryBean.kt

+13-1
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,28 @@ package com.skyd.anivu.model.bean.history
33
import android.os.Parcelable
44
import androidx.room.ColumnInfo
55
import androidx.room.Entity
6+
import androidx.room.ForeignKey
67
import androidx.room.PrimaryKey
78
import com.skyd.anivu.base.BaseBean
9+
import com.skyd.anivu.model.bean.article.ArticleBean
810
import kotlinx.parcelize.Parcelize
911
import kotlinx.serialization.Serializable
1012

1113
const val MEDIA_PLAY_HISTORY_TABLE_NAME = "MediaPlayHistory"
1214

1315
@Parcelize
1416
@Serializable
15-
@Entity(tableName = MEDIA_PLAY_HISTORY_TABLE_NAME)
17+
@Entity(
18+
tableName = MEDIA_PLAY_HISTORY_TABLE_NAME,
19+
foreignKeys = [
20+
ForeignKey(
21+
entity = ArticleBean::class,
22+
parentColumns = [ArticleBean.ARTICLE_ID_COLUMN],
23+
childColumns = [MediaPlayHistoryBean.ARTICLE_ID_COLUMN],
24+
onDelete = ForeignKey.CASCADE
25+
)
26+
],
27+
)
1628
data class MediaPlayHistoryBean(
1729
@PrimaryKey
1830
@ColumnInfo(name = PATH_COLUMN)

app/src/main/java/com/skyd/anivu/model/bean/playlist/PlaylistMediaBean.kt

+7
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import androidx.room.ForeignKey
77
import androidx.room.Ignore
88
import com.skyd.anivu.base.BaseBean
99
import com.skyd.anivu.ext.isLocalFile
10+
import com.skyd.anivu.model.bean.article.ArticleBean
1011
import kotlinx.serialization.Serializable
1112

1213
const val PLAYLIST_MEDIA_TABLE_NAME = "PlaylistMedia"
@@ -21,6 +22,12 @@ const val PLAYLIST_MEDIA_TABLE_NAME = "PlaylistMedia"
2122
parentColumns = [PlaylistBean.PLAYLIST_ID_COLUMN],
2223
childColumns = [PlaylistMediaBean.PLAYLIST_ID_COLUMN],
2324
onDelete = ForeignKey.CASCADE
25+
),
26+
ForeignKey(
27+
entity = ArticleBean::class,
28+
parentColumns = [ArticleBean.ARTICLE_ID_COLUMN],
29+
childColumns = [PlaylistMediaBean.ARTICLE_ID_COLUMN],
30+
onDelete = ForeignKey.CASCADE
2431
)
2532
],
2633
)

app/src/main/java/com/skyd/anivu/model/db/AppDatabase.kt

+3-2
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ import com.skyd.anivu.model.db.migration.Migration19To20
5050
import com.skyd.anivu.model.db.migration.Migration1To2
5151
import com.skyd.anivu.model.db.migration.Migration20To21
5252
import com.skyd.anivu.model.db.migration.Migration21To22
53+
import com.skyd.anivu.model.db.migration.Migration22To23
5354
import com.skyd.anivu.model.db.migration.Migration2To3
5455
import com.skyd.anivu.model.db.migration.Migration3To4
5556
import com.skyd.anivu.model.db.migration.Migration4To5
@@ -80,7 +81,7 @@ const val APP_DATA_BASE_FILE_NAME = "app.db"
8081
PlaylistMediaBean::class,
8182
],
8283
views = [FeedViewBean::class, PlaylistViewBean::class],
83-
version = 22,
84+
version = 23,
8485
)
8586
@TypeConverters(
8687
value = [RequestHeadersConverter::class]
@@ -111,7 +112,7 @@ abstract class AppDatabase : RoomDatabase() {
111112
Migration9To10(), Migration10To11(), Migration11To12(), Migration12To13(),
112113
Migration13To14(), Migration14To15(), Migration15To16(), Migration16To17(),
113114
Migration17To18(), Migration18To19(), Migration19To20(), Migration20To21(),
114-
Migration21To22()
115+
Migration21To22(), Migration22To23(),
115116
)
116117

117118
fun getInstance(context: Context): AppDatabase {

app/src/main/java/com/skyd/anivu/model/db/dao/ArticleDao.kt

+40-27
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package com.skyd.anivu.model.db.dao
22

33
import androidx.paging.PagingSource
44
import androidx.room.Dao
5-
import androidx.room.Delete
65
import androidx.room.Insert
76
import androidx.room.OnConflictStrategy
87
import androidx.room.Query
@@ -19,6 +18,8 @@ import com.skyd.anivu.model.bean.article.ENCLOSURE_TABLE_NAME
1918
import com.skyd.anivu.model.bean.article.EnclosureBean
2019
import com.skyd.anivu.model.bean.feed.FEED_TABLE_NAME
2120
import com.skyd.anivu.model.bean.feed.FeedBean
21+
import com.skyd.anivu.model.bean.playlist.PLAYLIST_MEDIA_TABLE_NAME
22+
import com.skyd.anivu.model.bean.playlist.PlaylistMediaBean
2223
import com.skyd.anivu.ui.notification.ArticleNotificationManager
2324
import dagger.hilt.EntryPoint
2425
import dagger.hilt.InstallIn
@@ -123,42 +124,53 @@ interface ArticleDao {
123124
}
124125

125126
@Transaction
126-
@Delete
127-
suspend fun deleteArticle(articleBean: ArticleBean): Int
128-
129-
@Transaction
130-
@Query("DELETE FROM $ARTICLE_TABLE_NAME WHERE ${ArticleBean.FEED_URL_COLUMN} LIKE :feedUrl")
131-
suspend fun deleteArticleInFeed(feedUrl: String): Int
127+
@Query(
128+
"DELETE FROM $ARTICLE_TABLE_NAME WHERE ${ArticleBean.FEED_URL_COLUMN} LIKE :feedUrl AND " +
129+
"NOT (:keepPlaylistArticles AND EXISTS(SELECT 1 FROM $PLAYLIST_MEDIA_TABLE_NAME pl " +
130+
" WHERE pl.${PlaylistMediaBean.ARTICLE_ID_COLUMN} = $ARTICLE_TABLE_NAME.${ArticleBean.ARTICLE_ID_COLUMN}))"
131+
)
132+
suspend fun deleteArticleInFeed(
133+
feedUrl: String,
134+
keepPlaylistArticles: Boolean,
135+
): Int
132136

133137
@Transaction
134138
@Query(
135-
"DELETE FROM $ARTICLE_TABLE_NAME WHERE ${ArticleBean.FEED_URL_COLUMN} IN (" +
136-
"SELECT ${FeedBean.URL_COLUMN} FROM $FEED_TABLE_NAME " +
137-
"WHERE ${FeedBean.GROUP_ID_COLUMN} IS NULL AND :groupId IS NULL OR " +
138-
"${FeedBean.GROUP_ID_COLUMN} = :groupId" +
139-
")"
139+
"DELETE FROM $ARTICLE_TABLE_NAME WHERE " +
140+
"${ArticleBean.FEED_URL_COLUMN} IN (" +
141+
" SELECT ${FeedBean.URL_COLUMN} FROM $FEED_TABLE_NAME " +
142+
" WHERE ${FeedBean.GROUP_ID_COLUMN} IS NULL AND :groupId IS NULL OR " +
143+
" ${FeedBean.GROUP_ID_COLUMN} = :groupId) AND " +
144+
"NOT (:keepPlaylistArticles AND EXISTS(SELECT 1 FROM $PLAYLIST_MEDIA_TABLE_NAME pl " +
145+
" WHERE pl.${PlaylistMediaBean.ARTICLE_ID_COLUMN} = $ARTICLE_TABLE_NAME.${ArticleBean.ARTICLE_ID_COLUMN}))"
140146
)
141-
suspend fun deleteArticlesInGroup(groupId: String?): Int
147+
suspend fun deleteArticlesInGroup(
148+
groupId: String?,
149+
keepPlaylistArticles: Boolean,
150+
): Int
142151

143152
@Transaction
144153
@Query(
145-
"""
146-
DELETE FROM $ARTICLE_TABLE_NAME
147-
WHERE (${ArticleBean.UPDATE_AT_COLUMN} IS NULL
148-
OR ${ArticleBean.UPDATE_AT_COLUMN} <= :timestamp)
149-
AND (:keepUnread = 0 OR ${ArticleBean.IS_READ_COLUMN} = 1)
150-
AND (:keepFavorite = 0 OR ${ArticleBean.IS_FAVORITE_COLUMN} = 0)
151-
"""
154+
"DELETE FROM $ARTICLE_TABLE_NAME WHERE " +
155+
"(${ArticleBean.UPDATE_AT_COLUMN} IS NULL OR " +
156+
"${ArticleBean.UPDATE_AT_COLUMN} <= :timestamp) AND " +
157+
"NOT (:keepPlaylistArticles AND EXISTS(SELECT 1 FROM $PLAYLIST_MEDIA_TABLE_NAME pl " +
158+
" WHERE pl.${PlaylistMediaBean.ARTICLE_ID_COLUMN} = $ARTICLE_TABLE_NAME.${ArticleBean.ARTICLE_ID_COLUMN})) AND " +
159+
"(:keepUnread = 0 OR ${ArticleBean.IS_READ_COLUMN} = 1) AND " +
160+
"(:keepFavorite = 0 OR ${ArticleBean.IS_FAVORITE_COLUMN} = 0)"
152161
)
153162
suspend fun deleteArticleBefore(
154163
timestamp: Long,
155-
keepUnread: Boolean = true,
156-
keepFavorite: Boolean = true,
164+
keepPlaylistArticles: Boolean,
165+
keepUnread: Boolean,
166+
keepFavorite: Boolean,
157167
): Int
158168

159169
@Transaction
160170
@Query(
161171
"DELETE FROM $ARTICLE_TABLE_NAME WHERE " +
172+
"NOT (:keepPlaylistArticles AND EXISTS(SELECT 1 FROM $PLAYLIST_MEDIA_TABLE_NAME pl " +
173+
" WHERE pl.${PlaylistMediaBean.ARTICLE_ID_COLUMN} = $ARTICLE_TABLE_NAME.${ArticleBean.ARTICLE_ID_COLUMN})) AND " +
162174
"(:keepUnread = 0 OR ${ArticleBean.IS_READ_COLUMN} = 1) AND " +
163175
"(:keepFavorite = 0 OR ${ArticleBean.IS_FAVORITE_COLUMN} = 0) AND " +
164176
"(" +
@@ -173,8 +185,9 @@ interface ArticleDao {
173185
)
174186
suspend fun deleteArticleExceed(
175187
count: Int,
176-
keepUnread: Boolean = true,
177-
keepFavorite: Boolean = true,
188+
keepPlaylistArticles: Boolean,
189+
keepUnread: Boolean,
190+
keepFavorite: Boolean,
178191
): Int
179192

180193
@Transaction
@@ -191,7 +204,7 @@ interface ArticleDao {
191204
"SELECT * FROM $ARTICLE_TABLE_NAME " +
192205
"WHERE ${ArticleBean.ARTICLE_ID_COLUMN} IN (:articleIds)"
193206
)
194-
fun getArticleListByIds(articleIds: List<String>): List<ArticleWithFeed>
207+
suspend fun getArticleListByIds(articleIds: List<String>): List<ArticleWithFeed>
195208

196209
@Transaction
197210
@Query(
@@ -204,8 +217,8 @@ interface ArticleDao {
204217

205218
@Transaction
206219
@Query(
207-
"SELECT COUNT(1) FROM $ARTICLE_TABLE_NAME " +
208-
"WHERE ${ArticleBean.ARTICLE_ID_COLUMN} LIKE :articleId"
220+
"SELECT EXISTS (SELECT 1 FROM $ARTICLE_TABLE_NAME " +
221+
"WHERE ${ArticleBean.ARTICLE_ID_COLUMN} LIKE :articleId)"
209222
)
210223
fun exists(articleId: String): Int
211224

app/src/main/java/com/skyd/anivu/model/db/dao/playlist/PlaylistDao.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ interface PlaylistDao {
5656

5757
@Transaction
5858
@Query(
59-
"SELECT `${PlaylistBean.PLAYLIST_ID_COLUMN}` FROM $PLAYLIST_TABLE_NAME " +
60-
"WHERE ${PlaylistBean.PLAYLIST_ID_COLUMN} = :playlistId"
59+
"SELECT EXISTS (SELECT 1 FROM $PLAYLIST_TABLE_NAME " +
60+
"WHERE ${PlaylistBean.PLAYLIST_ID_COLUMN} = :playlistId)"
6161
)
62-
suspend fun exists(playlistId: String): String?
62+
suspend fun exists(playlistId: String): Int
6363

6464
@Query(
6565
"SELECT MIN(${PlaylistBean.ORDER_POSITION_COLUMN}) FROM $PLAYLIST_TABLE_NAME WHERE " +

app/src/main/java/com/skyd/anivu/model/db/dao/playlist/PlaylistMediaDao.kt

+4-4
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,11 @@ interface PlaylistMediaDao {
9292

9393
@Transaction
9494
@Query(
95-
"SELECT `${PlaylistMediaBean.PLAYLIST_ID_COLUMN}` FROM $PLAYLIST_MEDIA_TABLE_NAME " +
96-
"WHERE ${PlaylistMediaBean.PLAYLIST_ID_COLUMN} = :playlistId AND " +
97-
"${PlaylistMediaBean.URL_COLUMN} = :url"
95+
"SELECT EXISTS (SELECT 1 FROM $PLAYLIST_MEDIA_TABLE_NAME WHERE " +
96+
"${PlaylistMediaBean.PLAYLIST_ID_COLUMN} = :playlistId AND " +
97+
"${PlaylistMediaBean.URL_COLUMN} = :url)"
9898
)
99-
suspend fun exists(playlistId: String, url: String): String?
99+
suspend fun exists(playlistId: String, url: String): Int
100100

101101
@Transaction
102102
@Query(
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
package com.skyd.anivu.model.db.migration
2+
3+
import androidx.room.migration.Migration
4+
import androidx.sqlite.db.SupportSQLiteDatabase
5+
import com.skyd.anivu.model.bean.article.ARTICLE_TABLE_NAME
6+
import com.skyd.anivu.model.bean.article.ArticleBean
7+
import com.skyd.anivu.model.bean.history.MEDIA_PLAY_HISTORY_TABLE_NAME
8+
import com.skyd.anivu.model.bean.history.MediaPlayHistoryBean
9+
import com.skyd.anivu.model.bean.playlist.PLAYLIST_MEDIA_TABLE_NAME
10+
import com.skyd.anivu.model.bean.playlist.PLAYLIST_TABLE_NAME
11+
import com.skyd.anivu.model.bean.playlist.PlaylistBean
12+
import com.skyd.anivu.model.bean.playlist.PlaylistMediaBean
13+
14+
class Migration22To23 : Migration(22, 23) {
15+
override fun migrate(db: SupportSQLiteDatabase) {
16+
db.execSQL(
17+
"CREATE TABLE `${PLAYLIST_MEDIA_TABLE_NAME}_Backup` (" +
18+
"${PlaylistMediaBean.PLAYLIST_ID_COLUMN} TEXT NOT NULL, " +
19+
"${PlaylistMediaBean.URL_COLUMN} TEXT NOT NULL, " +
20+
"${PlaylistMediaBean.ARTICLE_ID_COLUMN} TEXT, " +
21+
"${PlaylistMediaBean.ORDER_POSITION_COLUMN} REAL NOT NULL, " +
22+
"${PlaylistMediaBean.CREATE_TIME_COLUMN} INTEGER NOT NULL, " +
23+
"PRIMARY KEY (${PlaylistMediaBean.PLAYLIST_ID_COLUMN}, ${PlaylistMediaBean.URL_COLUMN}) " +
24+
"FOREIGN KEY (${PlaylistMediaBean.PLAYLIST_ID_COLUMN}) " +
25+
" REFERENCES $PLAYLIST_TABLE_NAME(${PlaylistBean.PLAYLIST_ID_COLUMN}) " +
26+
" ON DELETE CASCADE, " +
27+
"FOREIGN KEY (${PlaylistMediaBean.ARTICLE_ID_COLUMN}) " +
28+
" REFERENCES $ARTICLE_TABLE_NAME(${ArticleBean.ARTICLE_ID_COLUMN}) " +
29+
" ON DELETE CASCADE" +
30+
")"
31+
)
32+
db.execSQL(
33+
"CREATE TABLE `${MEDIA_PLAY_HISTORY_TABLE_NAME}_Backup` (" +
34+
"${MediaPlayHistoryBean.PATH_COLUMN} TEXT NOT NULL PRIMARY KEY, " +
35+
"${MediaPlayHistoryBean.DURATION_COLUMN} INTEGER NOT NULL, " +
36+
"${MediaPlayHistoryBean.LAST_PLAY_POSITION_COLUMN} INTEGER NOT NULL, " +
37+
"${MediaPlayHistoryBean.LAST_TIME_COLUMN} INTEGER NOT NULL, " +
38+
"${MediaPlayHistoryBean.ARTICLE_ID_COLUMN} TEXT, " +
39+
"FOREIGN KEY (${MediaPlayHistoryBean.ARTICLE_ID_COLUMN}) " +
40+
" REFERENCES $ARTICLE_TABLE_NAME(${ArticleBean.ARTICLE_ID_COLUMN}) " +
41+
" ON DELETE CASCADE" +
42+
")"
43+
)
44+
db.execSQL("INSERT OR IGNORE INTO ${PLAYLIST_MEDIA_TABLE_NAME}_Backup SELECT * FROM $PLAYLIST_MEDIA_TABLE_NAME")
45+
db.execSQL("INSERT OR IGNORE INTO ${MEDIA_PLAY_HISTORY_TABLE_NAME}_Backup SELECT * FROM $MEDIA_PLAY_HISTORY_TABLE_NAME")
46+
db.execSQL("DROP TABLE `$PLAYLIST_MEDIA_TABLE_NAME`")
47+
db.execSQL("ALTER TABLE ${PLAYLIST_MEDIA_TABLE_NAME}_Backup RENAME to `$PLAYLIST_MEDIA_TABLE_NAME`")
48+
db.execSQL("DROP TABLE `$MEDIA_PLAY_HISTORY_TABLE_NAME`")
49+
db.execSQL("ALTER TABLE ${MEDIA_PLAY_HISTORY_TABLE_NAME}_Backup RENAME to `$MEDIA_PLAY_HISTORY_TABLE_NAME`")
50+
}
51+
}

0 commit comments

Comments
 (0)