mirror of
https://github.com/f-droid/fdroidclient.git
synced 2026-05-02 12:44:05 -04:00
[db] Add DB query for getting repos an app is in
This commit is contained in:
@@ -70,6 +70,12 @@ public interface AppDao {
|
||||
*/
|
||||
public fun getApp(repoId: Long, packageName: String): App?
|
||||
|
||||
/**
|
||||
* Returns a list of all enabled repositories identified by their [Repository.repoId]
|
||||
* that contain the app identified by the given [packageName].
|
||||
*/
|
||||
public fun getRepositoryIdsForApp(packageName: String): List<Long>
|
||||
|
||||
/**
|
||||
* Returns a limited number of apps with limited data.
|
||||
* Apps without name, icon or summary are at the end (or excluded if limit is too small).
|
||||
@@ -316,6 +322,11 @@ internal interface AppDaoInt : AppDao {
|
||||
WHERE repoId = :repoId AND packageName = :packageName""")
|
||||
override fun getApp(repoId: Long, packageName: String): App?
|
||||
|
||||
@Query("""SELECT repoId FROM ${AppMetadata.TABLE}
|
||||
JOIN RepositoryPreferences AS pref USING (repoId)
|
||||
WHERE pref.enabled = 1 AND packageName = :packageName""")
|
||||
override fun getRepositoryIdsForApp(packageName: String): List<Long>
|
||||
|
||||
/**
|
||||
* Used for diffing.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user