generated from JetBrains/compose-multiplatform-template
-
-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Google API for fetching fav icon of the source
This is a temporary fix and a more robust approach will be pushed later
- Loading branch information
1 parent
d941f0f
commit c26ab49
Showing
2 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import kotlin.Boolean; | ||
import kotlinx.datetime.Instant; | ||
|
||
ALTER TABLE feed RENAME TO feed_old; | ||
|
||
DROP INDEX feed_link_index; | ||
DROP INDEX feed_pinned_at; | ||
DROP INDEX feed_pinned_position; | ||
|
||
CREATE TABLE IF NOT EXISTS feed( | ||
id TEXT NOT NULL PRIMARY KEY, | ||
name TEXT NOT NULL, | ||
icon TEXT NOT NULL, | ||
description TEXT NOT NULL, | ||
link TEXT NOT NULL, | ||
homepageLink TEXT NOT NULL, | ||
createdAt INTEGER AS Instant NOT NULL, | ||
pinnedAt INTEGER AS Instant, | ||
lastCleanUpAt INTEGER AS Instant, | ||
alwaysFetchSourceArticle INTEGER AS Boolean NOT NULL DEFAULT 0, | ||
pinnedPosition REAL NOT NULL DEFAULT 0.0 | ||
); | ||
|
||
CREATE INDEX feed_link_index ON feed(link); | ||
CREATE INDEX feed_pinned_at ON feed(pinnedAt); | ||
CREATE INDEX feed_pinned_position ON feed(pinnedPosition); | ||
|
||
INSERT INTO feed( | ||
id, | ||
name, | ||
icon, | ||
description, | ||
link, | ||
homepageLink, | ||
createdAt, | ||
pinnedAt, | ||
lastCleanUpAt, | ||
alwaysFetchSourceArticle, | ||
pinnedPosition | ||
) | ||
SELECT | ||
id, | ||
name, | ||
'https://www.google.com/s2/favicons?domain=' || homepageLink || '&sz=180' AS icon, | ||
description, | ||
link, | ||
homepageLink, | ||
createdAt, | ||
pinnedAt, | ||
lastCleanUpAt, | ||
alwaysFetchSourceArticle, | ||
pinnedPosition | ||
FROM feed_old; | ||
|
||
DROP TABLE feed_old; |