Skip to content

Commit

Permalink
Merge branch 'Ashinch:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
MauroGuida authored Jan 23, 2024
2 parents 16cb0ce + 9b061e4 commit e4ce9e3
Show file tree
Hide file tree
Showing 70 changed files with 676 additions and 339 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/build_commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,5 @@ jobs:

- uses: actions/upload-artifact@v3.1.1
with:
name: github-${{ github.sha }}
name: ReadYou-GitHub-Build-${{ github.sha }}
path: app/build/outputs/apk/github/release/*.apk
- uses: actions/upload-artifact@v3
with:
name: fdroid-${{ github.sha }}
path: app/build/outputs/apk/fdroid/release/*.apk
10 changes: 5 additions & 5 deletions README-de.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
<a target="_blank" href="https://github.com/Ashinch/ReadYou/blob/main/README-fa.md">فارسی</a></p>
<br/>
<br/>
<img src="https://raw.githubusercontent.com/Ashinch/ReadYou/main/fastlane/metadata/android/de-DE/images/startup.png" width="19.2%" alt="startup" />
<img src="https://raw.githubusercontent.com/Ashinch/ReadYou/main/fastlane/metadata/android/de-DE/images/feeds.png" width="19.2%" alt="feeds" />
<img src="https://raw.githubusercontent.com/Ashinch/ReadYou/main/fastlane/metadata/android/de-DE/images/flow.png" width="19.2%" alt="flow" />
<img src="https://raw.githubusercontent.com/Ashinch/ReadYou/main/fastlane/metadata/android/de-DE/images/read.png" width="19.2%" alt="read" />
<img src="https://raw.githubusercontent.com/Ashinch/ReadYou/main/fastlane/metadata/android/de-DE/images/settings.png" width="19.2%" alt="settings" />
<img src="https://raw.githubusercontent.com/Ashinch/ReadYou/main/fastlane/metadata/android/de-DE/images/phoneScreenshots/startup.png" width="19.2%" alt="startup" />
<img src="https://raw.githubusercontent.com/Ashinch/ReadYou/main/fastlane/metadata/android/de-DE/images/phoneScreenshots/feeds.png" width="19.2%" alt="feeds" />
<img src="https://raw.githubusercontent.com/Ashinch/ReadYou/main/fastlane/metadata/android/de-DE/images/phoneScreenshots/flow.png" width="19.2%" alt="flow" />
<img src="https://raw.githubusercontent.com/Ashinch/ReadYou/main/fastlane/metadata/android/de-DE/images/phoneScreenshots/read.png" width="19.2%" alt="read" />
<img src="https://raw.githubusercontent.com/Ashinch/ReadYou/main/fastlane/metadata/android/de-DE/images/phoneScreenshots/settings.png" width="19.2%" alt="settings" />
<br/>
<br/>
</div>
Expand Down
12 changes: 6 additions & 6 deletions README-fa.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div align="center">
<img width="200" height="200" style="display: block; border: 1px solid #f5f5f5; border-radius: 9999px;" src="./fastlane/metadata/android/en-US/images/icon.png">
<img width="200" height="200" style="display: block; border: 1px solid #f5f5f5; border-radius: 9999px;" src="https://raw.githubusercontent.com/Ashinch/ReadYou/main/fastlane/metadata/android/en-US/images/icon.png">
</div>

<br>
Expand Down Expand Up @@ -31,11 +31,11 @@
<a target="_blank" href="https://github.com/Ashinch/ReadYou/blob/main/README.md">English by DeepL</a></p>
<br/>
<br/>
<img src="./fastlane/metadata/android/en-US/images/startup.png" width="19.2%" alt="startup" />
<img src="./fastlane/metadata/android/en-US/images/feeds.png" width="19.2%" alt="startup" />
<img src="./fastlane/metadata/android/en-US/images/flow.png" width="19.2%" alt="startup" />
<img src="./fastlane/metadata/android/en-US/images/read.png" width="19.2%" alt="startup" />
<img src="./fastlane/metadata/android/en-US/images/settings.png" width="19.2%" alt="startup" />
<img src="https://raw.githubusercontent.com/Ashinch/ReadYou/main/fastlane/metadata/android/en-US/images/phoneScreenshots/startup.png" width="19.2%" alt="startup" />
<img src="https://raw.githubusercontent.com/Ashinch/ReadYou/main/fastlane/metadata/android/en-US/images/phoneScreenshots/feeds.png" width="19.2%" alt="feeds" />
<img src="https://raw.githubusercontent.com/Ashinch/ReadYou/main/fastlane/metadata/android/en-US/images/phoneScreenshots/flow.png" width="19.2%" alt="flow" />
<img src="https://raw.githubusercontent.com/Ashinch/ReadYou/main/fastlane/metadata/android/en-US/images/phoneScreenshots/read.png" width="19.2%" alt="read" />
<img src="https://raw.githubusercontent.com/Ashinch/ReadYou/main/fastlane/metadata/android/en-US/images/phoneScreenshots/settings.png" width="19.2%" alt="settings" />
<br/>
<br/>
</div>
Expand Down
12 changes: 6 additions & 6 deletions README-zh-CN.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div align="center">
<img width="200" height="200" style="display: block; border: 1px solid #f5f5f5; border-radius: 9999px;" src="https://raw.githubusercontent.com/Ashinch/ReadYou/main/fastlane/metadata/android/en-US/images/icon.png">
<img width="200" height="200" style="display: block; border: 1px solid #f5f5f5; border-radius: 9999px;" src="https://raw.githubusercontent.com/Ashinch/ReadYou/main/fastlane/metadata/android/zh-CN/images/icon.png">
</div>

<br>
Expand Down Expand Up @@ -31,11 +31,11 @@
<a target="_blank" href="https://github.com/Ashinch/ReadYou/blob/main/README-fa.md">فارسی</a></p>
<br/>
<br/>
<img src="https://raw.githubusercontent.com/Ashinch/ReadYou/main/fastlane/metadata/android/en-US/images/startup.png" width="19.2%" alt="startup" />
<img src="https://raw.githubusercontent.com/Ashinch/ReadYou/main/fastlane/metadata/android/en-US/images/feeds.png" width="19.2%" alt="feeds" />
<img src="https://raw.githubusercontent.com/Ashinch/ReadYou/main/fastlane/metadata/android/en-US/images/flow.png" width="19.2%" alt="flow" />
<img src="https://raw.githubusercontent.com/Ashinch/ReadYou/main/fastlane/metadata/android/en-US/images/read.png" width="19.2%" alt="read" />
<img src="https://raw.githubusercontent.com/Ashinch/ReadYou/main/fastlane/metadata/android/en-US/images/settings.png" width="19.2%" alt="settings" />
<img src="https://raw.githubusercontent.com/Ashinch/ReadYou/main/fastlane/metadata/android/zh-CN/images/phoneScreenshots/startup.png" width="19.2%"alt="startup" />
<img src="https://raw.githubusercontent.com/Ashinch/ReadYou/main/fastlane/metadata/android/zh-CN/images/phoneScreenshots/feeds.png" width="19.2%" alt="feeds" />
<img src="https://raw.githubusercontent.com/Ashinch/ReadYou/main/fastlane/metadata/android/zh-CN/images/phoneScreenshots/flow.png" width="19.2%" alt="flow" />
<img src="https://raw.githubusercontent.com/Ashinch/ReadYou/main/fastlane/metadata/android/zh-CN/images/phoneScreenshots/read.png" width="19.2%" alt="read" />
<img src="https://raw.githubusercontent.com/Ashinch/ReadYou/main/fastlane/metadata/android/zh-CN/images/phoneScreenshots/settings.png" width="19.2%" alt="settings" />
<br/>
<br/>
</div>
Expand Down
12 changes: 6 additions & 6 deletions README-zh-TW.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div align="center">
<img width="200" height="200" style="display: block; border: 1px solid #f5f5f5; border-radius: 9999px;" src="./fastlane/metadata/android/en-US/images/icon.png">
<img width="200" height="200" style="display: block; border: 1px solid #f5f5f5; border-radius: 9999px;" src="https://raw.githubusercontent.com/Ashinch/ReadYou/main/fastlane/metadata/android/zh-TW/images/icon.png">
</div>

<br>
Expand Down Expand Up @@ -31,11 +31,11 @@
繁體中文</p>
<br/>
<br/>
<img src="./fastlane/metadata/android/zh-rTW/images/startup.png" width="19.2%" alt="startup" />
<img src="./fastlane/metadata/android/zh-rTW/images/feeds.png" width="19.2%" alt="startup" />
<img src="./fastlane/metadata/android/zh-rTW/images/flow.png" width="19.2%" alt="startup" />
<img src="./fastlane/metadata/android/zh-rTW/images/read.png" width="19.2%" alt="startup" />
<img src="./fastlane/metadata/android/zh-rTW/images/settings.png" width="19.2%" alt="startup" />
<img src="https://raw.githubusercontent.com/Ashinch/ReadYou/main/fastlane/metadata/android/zh-TW/images/phoneScreenshots/startup.png" width="19.2%"alt="startup" />
<img src="https://raw.githubusercontent.com/Ashinch/ReadYou/main/fastlane/metadata/android/zh-TW/images/phoneScreenshots/feeds.png" width="19.2%" alt="feeds" />
<img src="https://raw.githubusercontent.com/Ashinch/ReadYou/main/fastlane/metadata/android/zh-TW/images/phoneScreenshots/flow.png" width="19.2%" alt="flow" />
<img src="https://raw.githubusercontent.com/Ashinch/ReadYou/main/fastlane/metadata/android/zh-TW/images/phoneScreenshots/read.png" width="19.2%" alt="read" />
<img src="https://raw.githubusercontent.com/Ashinch/ReadYou/main/fastlane/metadata/android/zh-TW/images/phoneScreenshots/settings.png" width="19.2%" alt="settings" />
<br/>
<br/>
</div>
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
<a target="_blank" href="https://github.com/Ashinch/ReadYou/blob/main/README-fa.md">فارسی (Outdated)</a></p>
<br/>
<br/>
<img src="https://raw.githubusercontent.com/Ashinch/ReadYou/main/fastlane/metadata/android/en-US/images/startup.png" width="19.2%" alt="startup" />
<img src="https://raw.githubusercontent.com/Ashinch/ReadYou/main/fastlane/metadata/android/en-US/images/feeds.png" width="19.2%" alt="feeds" />
<img src="https://raw.githubusercontent.com/Ashinch/ReadYou/main/fastlane/metadata/android/en-US/images/flow.png" width="19.2%" alt="flow" />
<img src="https://raw.githubusercontent.com/Ashinch/ReadYou/main/fastlane/metadata/android/en-US/images/read.png" width="19.2%" alt="read" />
<img src="https://raw.githubusercontent.com/Ashinch/ReadYou/main/fastlane/metadata/android/en-US/images/settings.png" width="19.2%" alt="settings" />
<img src="https://raw.githubusercontent.com/Ashinch/ReadYou/main/fastlane/metadata/android/en-US/images/phoneScreenshots/startup.png" width="19.2%" alt="startup" />
<img src="https://raw.githubusercontent.com/Ashinch/ReadYou/main/fastlane/metadata/android/en-US/images/phoneScreenshots/feeds.png" width="19.2%" alt="feeds" />
<img src="https://raw.githubusercontent.com/Ashinch/ReadYou/main/fastlane/metadata/android/en-US/images/phoneScreenshots/flow.png" width="19.2%" alt="flow" />
<img src="https://raw.githubusercontent.com/Ashinch/ReadYou/main/fastlane/metadata/android/en-US/images/phoneScreenshots/read.png" width="19.2%" alt="read" />
<img src="https://raw.githubusercontent.com/Ashinch/ReadYou/main/fastlane/metadata/android/en-US/images/phoneScreenshots/settings.png" width="19.2%" alt="settings" />
<br/>
<br/>
</div>
Expand Down
4 changes: 4 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ android {
fdroid {
dimension "channel"
}
googlePlay {
dimension "channel"
applicationIdSuffix ".google.play"
}
github {
dimension "channel"
}
Expand Down
55 changes: 55 additions & 0 deletions app/src/googlePlay/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>

<queries>
<intent>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.APP_BROWSER" />
</intent>
<intent>
<action android:name="android.intent.action.VIEW" />
</intent>
</queries>

<application
android:name=".infrastructure.android.AndroidApp"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/read_you"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.Reader"
android:usesCleartextTraffic="true">
<activity
android:name=".infrastructure.android.MainActivity"
android:exported="true"
android:theme="@style/Theme.Reader">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<provider
android:name="androidx.startup.InitializationProvider"
android:authorities="${applicationId}.androidx-startup"
tools:node="remove" />

<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.fileprovider"
android:exported="false"
android:grantUriPermissions="true"
tools:node="remove">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" />
</provider>
</application>

</manifest>
Binary file added app/src/googlePlay/ic_launcher-playstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
67 changes: 64 additions & 3 deletions app/src/main/java/me/ash/reader/domain/repository/ArticleDao.kt
Original file line number Diff line number Diff line change
Expand Up @@ -562,9 +562,70 @@ interface ArticleDao {
ORDER BY date DESC
"""
)
fun queryArticleMetadataAll(
accountId: Int,
): List<ArticleMeta>
fun queryMetadataAll(accountId: Int): List<ArticleMeta>

@Transaction
@Query(
"""
SELECT id, isUnread, isStarred FROM article
WHERE accountId = :accountId
AND date < :before
ORDER BY date DESC
"""
)
fun queryMetadataAll(accountId: Int, before: Date): List<ArticleMeta>

@Transaction
@Query(
"""
SELECT id, isUnread, isStarred FROM article
WHERE accountId = :accountId
AND feedId = :feedId
ORDER BY date DESC
"""
)
fun queryMetadataByFeedId(accountId: Int, feedId: String): List<ArticleMeta>

@Transaction
@Query(
"""
SELECT id, isUnread, isStarred FROM article
WHERE accountId = :accountId
AND feedId = :feedId
AND date < :before
ORDER BY date DESC
"""
)
fun queryMetadataByFeedId(accountId: Int, feedId: String, before: Date): List<ArticleMeta>

@Transaction
@Query(
"""
SELECT a.id, a.isUnread, a.isStarred
FROM article AS a
LEFT JOIN feed AS b ON b.id = a.feedId
LEFT JOIN `group` AS c ON c.id = b.groupId
WHERE c.id = :groupId
AND a.accountId = :accountId
ORDER BY a.date DESC
"""
)
fun queryMetadataByGroupId(accountId: Int, groupId: String): List<ArticleMeta>

@Transaction
@Query(
"""
SELECT a.id, a.isUnread, a.isStarred
FROM article AS a
LEFT JOIN feed AS b ON b.id = a.feedId
LEFT JOIN `group` AS c ON c.id = b.groupId
WHERE c.id = :groupId
AND a.accountId = :accountId
AND a.date < :before
ORDER BY a.date DESC
"""
)
fun queryMetadataByGroupId(accountId: Int, groupId: String, before: Date): List<ArticleMeta>

@Insert(onConflict = OnConflictStrategy.REPLACE)
suspend fun insert(vararg article: Article)
Expand Down
15 changes: 14 additions & 1 deletion app/src/main/java/me/ash/reader/domain/repository/FeedDao.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package me.ash.reader.domain.repository

import android.util.Log
import androidx.room.*
import me.ash.reader.domain.model.feed.Feed

Expand Down Expand Up @@ -91,7 +92,16 @@ interface FeedDao {
"""
SELECT * FROM feed
WHERE accountId = :accountId
and url = :url
AND (icon IS NUll OR icon = '')
"""
)
suspend fun queryNoIcon(accountId: Int): List<Feed>

@Query(
"""
SELECT * FROM feed
WHERE accountId = :accountId
AND url = :url
"""
)
suspend fun queryByLink(accountId: Int, url: String): List<Feed>
Expand All @@ -114,6 +124,9 @@ interface FeedDao {
if (feed == null) {
insert(it)
} else {
Log.i("RLog", "insertOrUpdate it: $it")
Log.i("RLog", "insertOrUpdate feed: $feed")
if (it.icon.isNullOrEmpty()) it.icon = feed.icon
// TODO: Consider migrating the fields to be nullable.
it.isNotification = feed.isNotification
it.isFullContent = feed.isFullContent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import me.ash.reader.infrastructure.preference.KeepArchivedPreference
import me.ash.reader.infrastructure.preference.SyncIntervalPreference
import me.ash.reader.infrastructure.rss.RssHelper
import me.ash.reader.ui.ext.currentAccountId
import me.ash.reader.ui.ext.decodeHTML
import me.ash.reader.ui.ext.spacerDollar
import java.util.*

Expand Down Expand Up @@ -61,7 +62,7 @@ abstract class AbstractRssRepository(
val accountId = context.currentAccountId
val feed = Feed(
id = accountId.spacerDollar(UUID.randomUUID().toString()),
name = searchedFeed.title!!,
name = searchedFeed.title.decodeHTML()!!,
url = feedLink,
groupId = groupId,
accountId = accountId,
Expand Down Expand Up @@ -166,13 +167,9 @@ abstract class AbstractRssRepository(
val latest = articleDao.queryLatestByFeedId(context.currentAccountId, feed.id)
val articles = rssHelper.queryRssXml(feed, latest?.link)
if (feed.icon == null) {
try {
val iconLink = rssHelper.queryRssIconLink(feed.url)
if (iconLink != null) {
rssHelper.saveRssIcon(feedDao, feed, iconLink)
}
} catch (e: Exception) {
Log.i("RLog", "queryRssIcon is failed: ${e.message}")
val iconLink = rssHelper.queryRssIconLink(feed.url)
if (iconLink != null) {
rssHelper.saveRssIcon(feedDao, feed, iconLink)
}
}
return FeedWithArticle(
Expand Down
Loading

0 comments on commit e4ce9e3

Please sign in to comment.