Skip to content

Commit f9da2a1

Browse files
Added blacklist for media,
Added separate database for history, Fixed dialog dim colors, Remember greeting message, Fixed PullToRefreshBox color in home, Filter by age rating cached media, Automatically dismiss toast after clicking at it
1 parent 31a71aa commit f9da2a1

File tree

19 files changed

+794
-188
lines changed

19 files changed

+794
-188
lines changed
Lines changed: 291 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,291 @@
1+
{
2+
"formatVersion": 1,
3+
"database": {
4+
"version": 2,
5+
"identityHash": "3a4f8bd906afa0f3b9e3efec414982d5",
6+
"entities": [
7+
{
8+
"tableName": "DBMedia",
9+
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`extensionId` TEXT NOT NULL, `id` TEXT NOT NULL, `json` TEXT NOT NULL, PRIMARY KEY(`extensionId`, `id`))",
10+
"fields": [
11+
{
12+
"fieldPath": "extensionId",
13+
"columnName": "extensionId",
14+
"affinity": "TEXT",
15+
"notNull": true
16+
},
17+
{
18+
"fieldPath": "id",
19+
"columnName": "id",
20+
"affinity": "TEXT",
21+
"notNull": true
22+
},
23+
{
24+
"fieldPath": "json",
25+
"columnName": "json",
26+
"affinity": "TEXT",
27+
"notNull": true
28+
}
29+
],
30+
"primaryKey": {
31+
"autoGenerate": false,
32+
"columnNames": [
33+
"extensionId",
34+
"id"
35+
]
36+
}
37+
},
38+
{
39+
"tableName": "DBList",
40+
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `name` TEXT NOT NULL, `orderIndex` INTEGER NOT NULL, `hidden` INTEGER NOT NULL, `autoUpdateItems` INTEGER NOT NULL)",
41+
"fields": [
42+
{
43+
"fieldPath": "id",
44+
"columnName": "id",
45+
"affinity": "INTEGER",
46+
"notNull": true
47+
},
48+
{
49+
"fieldPath": "name",
50+
"columnName": "name",
51+
"affinity": "TEXT",
52+
"notNull": true
53+
},
54+
{
55+
"fieldPath": "orderIndex",
56+
"columnName": "orderIndex",
57+
"affinity": "INTEGER",
58+
"notNull": true
59+
},
60+
{
61+
"fieldPath": "hidden",
62+
"columnName": "hidden",
63+
"affinity": "INTEGER",
64+
"notNull": true
65+
},
66+
{
67+
"fieldPath": "autoUpdateItems",
68+
"columnName": "autoUpdateItems",
69+
"affinity": "INTEGER",
70+
"notNull": true
71+
}
72+
],
73+
"primaryKey": {
74+
"autoGenerate": true,
75+
"columnNames": [
76+
"id"
77+
]
78+
}
79+
},
80+
{
81+
"tableName": "DBListMediaCrossRef",
82+
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`mediaExtensionId` TEXT NOT NULL, `mediaId` TEXT NOT NULL, `listId` INTEGER NOT NULL, PRIMARY KEY(`mediaExtensionId`, `mediaId`, `listId`), FOREIGN KEY(`mediaExtensionId`, `mediaId`) REFERENCES `DBMedia`(`extensionId`, `id`) ON UPDATE NO ACTION ON DELETE CASCADE , FOREIGN KEY(`listId`) REFERENCES `DBList`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )",
83+
"fields": [
84+
{
85+
"fieldPath": "mediaExtensionId",
86+
"columnName": "mediaExtensionId",
87+
"affinity": "TEXT",
88+
"notNull": true
89+
},
90+
{
91+
"fieldPath": "mediaId",
92+
"columnName": "mediaId",
93+
"affinity": "TEXT",
94+
"notNull": true
95+
},
96+
{
97+
"fieldPath": "listId",
98+
"columnName": "listId",
99+
"affinity": "INTEGER",
100+
"notNull": true
101+
}
102+
],
103+
"primaryKey": {
104+
"autoGenerate": false,
105+
"columnNames": [
106+
"mediaExtensionId",
107+
"mediaId",
108+
"listId"
109+
]
110+
},
111+
"indices": [
112+
{
113+
"name": "index_DBListMediaCrossRef_mediaExtensionId_mediaId_listId",
114+
"unique": false,
115+
"columnNames": [
116+
"mediaExtensionId",
117+
"mediaId",
118+
"listId"
119+
],
120+
"orders": [],
121+
"createSql": "CREATE INDEX IF NOT EXISTS `index_DBListMediaCrossRef_mediaExtensionId_mediaId_listId` ON `${TABLE_NAME}` (`mediaExtensionId`, `mediaId`, `listId`)"
122+
}
123+
],
124+
"foreignKeys": [
125+
{
126+
"table": "DBMedia",
127+
"onDelete": "CASCADE",
128+
"onUpdate": "NO ACTION",
129+
"columns": [
130+
"mediaExtensionId",
131+
"mediaId"
132+
],
133+
"referencedColumns": [
134+
"extensionId",
135+
"id"
136+
]
137+
},
138+
{
139+
"table": "DBList",
140+
"onDelete": "CASCADE",
141+
"onUpdate": "NO ACTION",
142+
"columns": [
143+
"listId"
144+
],
145+
"referencedColumns": [
146+
"id"
147+
]
148+
}
149+
]
150+
},
151+
{
152+
"tableName": "DBWatchProgress",
153+
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`extensionId` TEXT NOT NULL, `mediaId` TEXT NOT NULL, `variantId` TEXT NOT NULL, `progress` INTEGER NOT NULL, `maxProgress` INTEGER, `title` TEXT NOT NULL, `thumbnail` TEXT, PRIMARY KEY(`extensionId`, `mediaId`, `variantId`))",
154+
"fields": [
155+
{
156+
"fieldPath": "extensionId",
157+
"columnName": "extensionId",
158+
"affinity": "TEXT",
159+
"notNull": true
160+
},
161+
{
162+
"fieldPath": "mediaId",
163+
"columnName": "mediaId",
164+
"affinity": "TEXT",
165+
"notNull": true
166+
},
167+
{
168+
"fieldPath": "variantId",
169+
"columnName": "variantId",
170+
"affinity": "TEXT",
171+
"notNull": true
172+
},
173+
{
174+
"fieldPath": "progress",
175+
"columnName": "progress",
176+
"affinity": "INTEGER",
177+
"notNull": true
178+
},
179+
{
180+
"fieldPath": "maxProgress",
181+
"columnName": "maxProgress",
182+
"affinity": "INTEGER"
183+
},
184+
{
185+
"fieldPath": "title",
186+
"columnName": "title",
187+
"affinity": "TEXT",
188+
"notNull": true
189+
},
190+
{
191+
"fieldPath": "thumbnail",
192+
"columnName": "thumbnail",
193+
"affinity": "TEXT"
194+
}
195+
],
196+
"primaryKey": {
197+
"autoGenerate": false,
198+
"columnNames": [
199+
"extensionId",
200+
"mediaId",
201+
"variantId"
202+
]
203+
}
204+
},
205+
{
206+
"tableName": "DBRepository",
207+
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`extensionId` TEXT NOT NULL, `name` TEXT NOT NULL, `url` TEXT NOT NULL, PRIMARY KEY(`extensionId`, `url`))",
208+
"fields": [
209+
{
210+
"fieldPath": "extensionId",
211+
"columnName": "extensionId",
212+
"affinity": "TEXT",
213+
"notNull": true
214+
},
215+
{
216+
"fieldPath": "name",
217+
"columnName": "name",
218+
"affinity": "TEXT",
219+
"notNull": true
220+
},
221+
{
222+
"fieldPath": "url",
223+
"columnName": "url",
224+
"affinity": "TEXT",
225+
"notNull": true
226+
}
227+
],
228+
"primaryKey": {
229+
"autoGenerate": false,
230+
"columnNames": [
231+
"extensionId",
232+
"url"
233+
]
234+
}
235+
},
236+
{
237+
"tableName": "blacklisted_media",
238+
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`extension_id` TEXT NOT NULL, `media_id` TEXT NOT NULL, `name` TEXT NOT NULL, PRIMARY KEY(`extension_id`, `media_id`))",
239+
"fields": [
240+
{
241+
"fieldPath": "extensionId",
242+
"columnName": "extension_id",
243+
"affinity": "TEXT",
244+
"notNull": true
245+
},
246+
{
247+
"fieldPath": "mediaId",
248+
"columnName": "media_id",
249+
"affinity": "TEXT",
250+
"notNull": true
251+
},
252+
{
253+
"fieldPath": "name",
254+
"columnName": "name",
255+
"affinity": "TEXT",
256+
"notNull": true
257+
}
258+
],
259+
"primaryKey": {
260+
"autoGenerate": false,
261+
"columnNames": [
262+
"extension_id",
263+
"media_id"
264+
]
265+
}
266+
},
267+
{
268+
"tableName": "blacklisted_keyword",
269+
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`name` TEXT NOT NULL, PRIMARY KEY(`name`))",
270+
"fields": [
271+
{
272+
"fieldPath": "name",
273+
"columnName": "name",
274+
"affinity": "TEXT",
275+
"notNull": true
276+
}
277+
],
278+
"primaryKey": {
279+
"autoGenerate": false,
280+
"columnNames": [
281+
"name"
282+
]
283+
}
284+
}
285+
],
286+
"setupQueries": [
287+
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
288+
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '3a4f8bd906afa0f3b9e3efec414982d5')"
289+
]
290+
}
291+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"formatVersion": 1,
3+
"database": {
4+
"version": 1,
5+
"identityHash": "196537c54da78e4fd3cd9024fec712d6",
6+
"entities": [
7+
{
8+
"tableName": "history_media",
9+
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`extension_id` TEXT NOT NULL, `media_id` TEXT NOT NULL, `date` INTEGER NOT NULL, `media` TEXT NOT NULL, PRIMARY KEY(`extension_id`, `media_id`))",
10+
"fields": [
11+
{
12+
"fieldPath": "extensionId",
13+
"columnName": "extension_id",
14+
"affinity": "TEXT",
15+
"notNull": true
16+
},
17+
{
18+
"fieldPath": "mediaId",
19+
"columnName": "media_id",
20+
"affinity": "TEXT",
21+
"notNull": true
22+
},
23+
{
24+
"fieldPath": "date",
25+
"columnName": "date",
26+
"affinity": "INTEGER",
27+
"notNull": true
28+
},
29+
{
30+
"fieldPath": "media",
31+
"columnName": "media",
32+
"affinity": "TEXT",
33+
"notNull": true
34+
}
35+
],
36+
"primaryKey": {
37+
"autoGenerate": false,
38+
"columnNames": [
39+
"extension_id",
40+
"media_id"
41+
]
42+
}
43+
}
44+
],
45+
"setupQueries": [
46+
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
47+
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '196537c54da78e4fd3cd9024fec712d6')"
48+
]
49+
}
50+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package com.mrboomdev.awery.data.database
2+
3+
import androidx.room.Room
4+
import androidx.room.RoomDatabase
5+
import com.mrboomdev.awery.core.Awery
6+
import com.mrboomdev.awery.core.context
7+
8+
internal actual fun createHistoryDatabase(
9+
block: RoomDatabase.Builder<AweryHistoryDatabase>.() -> Unit
10+
) = with(Awery.context) {
11+
Room.databaseBuilder(
12+
context = this,
13+
klass = AweryHistoryDatabase::class.java,
14+
name = getDatabasePath("history.db").absolutePath
15+
).apply(block).build()
16+
}

0 commit comments

Comments
 (0)