From 2eaf3e9cf33abeff2b1e48f02e9535235732fcfd Mon Sep 17 00:00:00 2001 From: Kolja Lampe Date: Sun, 28 Nov 2021 02:32:19 +0100 Subject: [PATCH 1/3] Saving the complete beta appstream in the same collection --- .github/workflows/ci.yml | 2 +- Dockerfile | 14 +- app/apps.py | 110 +++++---- app/db.py | 22 +- app/feeds.py | 32 ++- app/main.py | 34 ++- app/schemas.py | 6 + app/summary.py | 51 +++- app/utils.py | 2 +- .../beta-repo/appstream/x86_64/appstream.xml | 223 ++++++++++++++++++ tests/main.py | 53 ++++- tests/ostree/beta-repo/.lock | 0 tests/ostree/beta-repo/config | 4 + ...2066f6d932793bb61b728ca2b5d50ab4e3.dirtree | Bin 0 -> 49 bytes ...23028bb23e4e0f5f026a87e5fc08b6a81d32.filez | Bin 0 -> 244 bytes ...6595d09cb3d799ca6d2f4f6cc16b2f9358.dirtree | Bin 0 -> 191 bytes ...a4c300d500affa24c3aae26f29b17d555283.filez | Bin 0 -> 248 bytes ...4524102bb71d87d0c6fa70731d894b7a0a4b.filez | Bin 0 -> 123 bytes ...ddd2d3e3f55ff79f51ca8304e86033a57e47.filez | Bin 0 -> 246 bytes ...14b253fd83c6e344811cab851e70d56f8de.commit | Bin 0 -> 596 bytes ...eeb675faa412d5ec73f62988eb0b6c5488.dirmeta | Bin 0 -> 12 bytes ...c2cfa7ad59048722bb43de5847165cd332b0.filez | Bin 0 -> 125 bytes ...3e9103f85ca69050a355a00ff4ac272f1e4.commit | Bin 0 -> 588 bytes ...9588e6d2fce756b6e2ae4e228ae07206aff2.filez | Bin 0 -> 125 bytes ...2c78901d3fb33738768511a30617afa01d.dirtree | Bin 0 -> 1 bytes ...6bab41fd275eb548f415f63bb639d783bd.dirtree | Bin 0 -> 191 bytes ...b5d57bb3fe8f71c39748b9cc291cc8e95aa.commit | Bin 0 -> 604 bytes ...3eb494bb826d799888502f50d2353be399.dirtree | Bin 0 -> 49 bytes ...5316cf1fb6726e77d64e984fd9cbe951712.commit | Bin 0 -> 572 bytes ...13fae814aeb2ec6110bfc3ba945d4759d996.filez | Bin 0 -> 123 bytes ...536a40caf281a35f54f0f37390c71aef9d90.filez | Bin 0 -> 242 bytes ...fa78854364e807c81c426b3a71ae86061c.dirtree | Bin 0 -> 191 bytes ...fccba97e932cbe6cf493e38b84b078a7ee.dirtree | Bin 0 -> 49 bytes ...c0e9cb9b8b8785f3f328c28f2bdaf6beed.dirtree | Bin 0 -> 49 bytes ...a5a9324bcbd265cef3bf1f3674f24dc92f.dirtree | Bin 0 -> 191 bytes ...dbe7fffb57727d01b710ade20d027345e07.commit | Bin 0 -> 556 bytes .../app/com.anydesk.Anydesk/x86_64/stable | 1 + .../heads/app/com.wps.Office/x86_64/stable | 1 + .../app/org.sugarlabs.Maze/x86_64/stable | 1 + ...4b34f99a23a91595f43df348f82cbc580437.delta | Bin 0 -> 335 bytes ...799ad6004833ab59d4111f55048c357b651ae12.gz | Bin 0 -> 237 bytes ...7184b34f99a23a91595f43df348f82cbc580437.gz | Bin 0 -> 393 bytes ...4b34f99a23a91595f43df348f82cbc580437.delta | Bin 0 -> 329 bytes ...9c2b6a5c7156f17a7137ebcf941d67157c4a690.gz | Bin 0 -> 319 bytes ...4b34f99a23a91595f43df348f82cbc580437.delta | Bin 0 -> 261 bytes ...d105f97ffcfbd8347e0c80066eca80897422d3f.gz | Bin 0 -> 320 bytes ...4b34f99a23a91595f43df348f82cbc580437.delta | Bin 0 -> 336 bytes ...cb6795bc17f80e2efbc0a7218dd087b40dbe348.gz | Bin 0 -> 381 bytes tests/ostree/beta-repo/summary | Bin 0 -> 1195 bytes tests/ostree/beta-repo/summary.idx | Bin 0 -> 398 bytes tests/results/test_appstream_by_appid.json | 166 ++++++++----- .../test_appstream_by_appid_beta_only.json | 56 +++++ .../test_appstream_by_appid_stable_only.json | 112 +++++++++ tests/results/test_list_appstream_beta.json | 1 + .../test_list_appstream_stable_and_beta.json | 6 + tests/results/test_summary_by_appid.json | 34 ++- .../test_summary_by_appid_beta_only.json | 14 ++ .../test_summary_by_appid_stable_only.json | 14 ++ 58 files changed, 813 insertions(+), 146 deletions(-) create mode 100644 tests/appstream/beta-repo/appstream/x86_64/appstream.xml create mode 100644 tests/ostree/beta-repo/.lock create mode 100644 tests/ostree/beta-repo/config create mode 100644 tests/ostree/beta-repo/objects/06/e1f7778c81994966156b640349172066f6d932793bb61b728ca2b5d50ab4e3.dirtree create mode 100644 tests/ostree/beta-repo/objects/13/cf1de7f531b099bde97022106123028bb23e4e0f5f026a87e5fc08b6a81d32.filez create mode 100644 tests/ostree/beta-repo/objects/17/3b903b7c28b40bb3d48e0ec347c36595d09cb3d799ca6d2f4f6cc16b2f9358.dirtree create mode 100644 tests/ostree/beta-repo/objects/2c/870e3575fe530522d3c1308d39a4c300d500affa24c3aae26f29b17d555283.filez create mode 100644 tests/ostree/beta-repo/objects/3b/2099c61290dfb4fd31d5a081b64524102bb71d87d0c6fa70731d894b7a0a4b.filez create mode 100644 tests/ostree/beta-repo/objects/3c/897b707cffe07b5c896a983172ddd2d3e3f55ff79f51ca8304e86033a57e47.filez create mode 100644 tests/ostree/beta-repo/objects/44/214b76684c64afc0308c62313ec14b253fd83c6e344811cab851e70d56f8de.commit create mode 100644 tests/ostree/beta-repo/objects/44/6a0ef11b7cc167f3b603e585c7eeeeb675faa412d5ec73f62988eb0b6c5488.dirmeta create mode 100644 tests/ostree/beta-repo/objects/4b/1bbd9195d5d593e6bb103f8561c2cfa7ad59048722bb43de5847165cd332b0.filez create mode 100644 tests/ostree/beta-repo/objects/52/9106b1800fed122ab0cbc72ad603e9103f85ca69050a355a00ff4ac272f1e4.commit create mode 100644 tests/ostree/beta-repo/objects/57/ff61d7adf7fb37053348253b2f9588e6d2fce756b6e2ae4e228ae07206aff2.filez create mode 100644 tests/ostree/beta-repo/objects/6e/340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d.dirtree create mode 100644 tests/ostree/beta-repo/objects/97/7b12b09e51e36c19376aa6f533fd6bab41fd275eb548f415f63bb639d783bd.dirtree create mode 100644 tests/ostree/beta-repo/objects/9f/5db1c17fcefa600b0c51b714526b5d57bb3fe8f71c39748b9cc291cc8e95aa.commit create mode 100644 tests/ostree/beta-repo/objects/9f/7128805558dbeafd19bb22ca51623eb494bb826d799888502f50d2353be399.dirtree create mode 100644 tests/ostree/beta-repo/objects/a6/5f1a6cce2e4a0a161a55754bbbf5316cf1fb6726e77d64e984fd9cbe951712.commit create mode 100644 tests/ostree/beta-repo/objects/af/e62d9d85075279e3d675fc4e9313fae814aeb2ec6110bfc3ba945d4759d996.filez create mode 100644 tests/ostree/beta-repo/objects/bd/18589ad0b3b9ecbc1ad369f188536a40caf281a35f54f0f37390c71aef9d90.filez create mode 100644 tests/ostree/beta-repo/objects/c5/2b7a71e67a79ddc1a3d6f42b5895fa78854364e807c81c426b3a71ae86061c.dirtree create mode 100644 tests/ostree/beta-repo/objects/e5/6d2aea757ab43320c72f3d502fcbfccba97e932cbe6cf493e38b84b078a7ee.dirtree create mode 100644 tests/ostree/beta-repo/objects/ea/f29e2dbc0c7e0fa8e9ad153d86efc0e9cb9b8b8785f3f328c28f2bdaf6beed.dirtree create mode 100644 tests/ostree/beta-repo/objects/f0/6b9b14640c286d42433932090169a5a9324bcbd265cef3bf1f3674f24dc92f.dirtree create mode 100644 tests/ostree/beta-repo/objects/ff/dfe498fb7016c4282e5369534a3dbe7fffb57727d01b710ade20d027345e07.commit create mode 100644 tests/ostree/beta-repo/refs/heads/app/com.anydesk.Anydesk/x86_64/stable create mode 100644 tests/ostree/beta-repo/refs/heads/app/com.wps.Office/x86_64/stable create mode 100644 tests/ostree/beta-repo/refs/heads/app/org.sugarlabs.Maze/x86_64/stable create mode 100644 tests/ostree/beta-repo/summaries/2c7d1e349de7d0b20bb73cc76799ad6004833ab59d4111f55048c357b651ae12-386998efb2f56f8ba0981d9ad7184b34f99a23a91595f43df348f82cbc580437.delta create mode 100644 tests/ostree/beta-repo/summaries/2c7d1e349de7d0b20bb73cc76799ad6004833ab59d4111f55048c357b651ae12.gz create mode 100644 tests/ostree/beta-repo/summaries/386998efb2f56f8ba0981d9ad7184b34f99a23a91595f43df348f82cbc580437.gz create mode 100644 tests/ostree/beta-repo/summaries/76d192d80f282a6963af9782e9c2b6a5c7156f17a7137ebcf941d67157c4a690-386998efb2f56f8ba0981d9ad7184b34f99a23a91595f43df348f82cbc580437.delta create mode 100644 tests/ostree/beta-repo/summaries/76d192d80f282a6963af9782e9c2b6a5c7156f17a7137ebcf941d67157c4a690.gz create mode 100644 tests/ostree/beta-repo/summaries/94bee1ee1bbd230aba77f907dd105f97ffcfbd8347e0c80066eca80897422d3f-386998efb2f56f8ba0981d9ad7184b34f99a23a91595f43df348f82cbc580437.delta create mode 100644 tests/ostree/beta-repo/summaries/94bee1ee1bbd230aba77f907dd105f97ffcfbd8347e0c80066eca80897422d3f.gz create mode 100644 tests/ostree/beta-repo/summaries/da0308f06b33f241439b4717fcb6795bc17f80e2efbc0a7218dd087b40dbe348-386998efb2f56f8ba0981d9ad7184b34f99a23a91595f43df348f82cbc580437.delta create mode 100644 tests/ostree/beta-repo/summaries/da0308f06b33f241439b4717fcb6795bc17f80e2efbc0a7218dd087b40dbe348.gz create mode 100644 tests/ostree/beta-repo/summary create mode 100644 tests/ostree/beta-repo/summary.idx create mode 100644 tests/results/test_appstream_by_appid_beta_only.json create mode 100644 tests/results/test_appstream_by_appid_stable_only.json create mode 100644 tests/results/test_list_appstream_beta.json create mode 100644 tests/results/test_list_appstream_stable_and_beta.json create mode 100644 tests/results/test_summary_by_appid_beta_only.json create mode 100644 tests/results/test_summary_by_appid_stable_only.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f82e5c0..ce90de1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: - uses: actions/setup-python@v2 with: - python-version: "3.9" + python-version: "3.10" - uses: actions/cache@v2 with: diff --git a/Dockerfile b/Dockerfile index b0d3402..0cb459c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,24 +1,26 @@ -FROM python:3.9 as builder +FROM python:3.10 as builder RUN apt-get update && \ apt-get install -y --no-install-recommends \ - build-essential libcairo2-dev libgirepository1.0-dev \ - gir1.2-ostree-1.0 flatpak + build-essential libcairo2-dev libgirepository1.0-dev \ + gir1.2-ostree-1.0 flatpak ADD requirements.txt /requirements.txt RUN python -m venv /venv && \ /venv/bin/pip install -r requirements.txt \ && rm -f /requirements.txt -FROM python:3.9-slim +FROM python:3.10-slim EXPOSE 8000 RUN apt-get update && \ apt-get install -y --no-install-recommends \ - libcairo2 gir1.2-ostree-1.0 flatpak && \ + libcairo2 gir1.2-ostree-1.0 flatpak && \ apt-get clean && rm -rf /var/lib/apt/lists/* && \ - flatpak --user remote-add flathub https://flathub.org/repo/flathub.flatpakrepo + flatpak --user remote-add flathub https://flathub.org/repo/flathub.flatpakrepo && \ + flatpak --user remote-add flathub-beta https://flathub.org/beta-repo/flathub-beta.flatpakrepo + COPY ./app /app COPY ./data /data diff --git a/app/apps.py b/app/apps.py index 7928052..f0d032f 100644 --- a/app/apps.py +++ b/app/apps.py @@ -6,9 +6,13 @@ def load_appstream(): - apps = utils.appstream2dict("repo") + apps_stable = utils.appstream2dict("repo") + apps_beta = utils.appstream2dict("beta-repo") - current_apps = {app[5:] for app in db.redis_conn.smembers("apps:index")} + apps = merge_apps(apps_beta, apps_stable) + + current_apps = db.get_apps("stable") + current_apps_beta = db.get_apps("beta") current_categories = db.redis_conn.smembers("categories:index") db.initialize() @@ -19,30 +23,32 @@ def load_appstream(): redis_key = f"apps:{appid}" clean_html_re = re.compile("<.*?>") - search_description = re.sub(clean_html_re, "", apps[appid]["description"]) - - if search_keywords := apps[appid].get("keywords"): - search_keywords = " ".join(search_keywords) - else: - search_keywords = "" - - fts = { - "id": appid, - "name": apps[appid]["name"], - "summary": apps[appid]["summary"], - "description": search_description, - "keywords": search_keywords, - } + if "stable" in apps[appid]: + search_description = re.sub( + clean_html_re, "", apps[appid]["stable"]["description"] + ) + + if search_keywords := apps[appid]["stable"].get("keywords"): + search_keywords = " ".join(search_keywords) + else: + search_keywords = "" + + fts = { + "id": appid, + "name": apps[appid]["stable"]["name"], + "summary": apps[appid]["stable"]["summary"], + "description": search_description, + "keywords": search_keywords, + } + p.hset(f"fts:{appid}", mapping=fts) + if categories := apps[appid]["stable"].get("categories"): + for category in categories: + p.sadd("categories:index", category) + p.sadd(f"categories:{category}", redis_key) p.set(f"apps:{appid}", json.dumps(apps[appid])) - p.hset(f"fts:{appid}", mapping=fts) - if categories := apps[appid].get("categories"): - for category in categories: - p.sadd("categories:index", category) - p.sadd(f"categories:{category}", redis_key) - - for appid in current_apps - set(apps): + for appid in current_apps - set(apps_stable): p.delete( f"apps:{appid}", f"fts:{appid}", @@ -51,51 +57,75 @@ def load_appstream(): ) db.redis_search.delete_document(f"fts:{appid}") - new_apps = set(apps) - current_apps + new_apps = set(apps_stable) - current_apps if not len(new_apps): new_apps = None + new_apps_beta = set(apps_beta) - current_apps_beta + if not len(new_apps_beta): + new_apps_beta = None + p.delete("apps:index") - p.sadd("apps:index", *[f"apps:{appid}" for appid in apps]) + p.sadd("apps:index", *[f"apps:{appid}" for appid in apps_stable]) + p.delete("apps:index_beta") + p.sadd("apps:index_beta", *[f"apps:{appid}" for appid in apps_beta]) p.execute() - return new_apps + return new_apps, new_apps_beta + + +def merge_apps(apps_beta, apps_stable): + apps = {} + for appid in apps_stable: + apps[appid] = {"stable": apps_stable[appid]} + + for appid in apps_beta: + if appid not in apps: + apps[appid] = {"beta": apps_beta[appid]} + else: + apps[appid] = {"stable": apps_stable[appid], "beta": apps_beta[appid]} + + return apps def list_appstream(repo: str = "stable"): - apps = {app[5:] for app in db.redis_conn.smembers("apps:index")} - return sorted(apps) + return sorted(db.get_apps(repo)) + +def get_recently_updated(limit: int = 100, repo: str = "stable"): + if repo == "stable": + zset = db.redis_conn.zrevrange("recently_updated_zset", 0, limit - 1) + if repo == "beta": + zset = db.redis_conn.zrevrange("recently_updated_beta_zset", 0, limit - 1) -def get_recently_updated(limit: int = 100): - zset = db.redis_conn.zrevrange("recently_updated_zset", 0, limit - 1) return [appid for appid in zset if db.redis_conn.exists(f"apps:{appid}")] -def get_category(category: str): +def get_category(category: str, repo: str = "stable"): if index := db.redis_conn.smembers(f"categories:{category}"): json_appdata = db.redis_conn.mget(index) appdata = [json.loads(app) for app in json_appdata] - return [(app["id"]) for app in appdata] + return [(app[repo]["id"]) for app in appdata if repo in app] else: return [] -def search(query: str): +def search(query: str, repo: str = "stable"): if results := db.search(query): appids = tuple(doc_id.replace("fts", "apps") for doc_id in results) apps = [json.loads(x) for x in db.redis_conn.mget(appids)] ret = [] for app in apps: - entry = { - "id": app["id"], - "name": app["name"], - "summary": app["summary"], - "icon": app.get("icon"), - } - ret.append(entry) + if repo in app: + entry = { + "id": app[repo]["id"], + "name": app[repo]["name"], + "summary": app[repo]["summary"], + "icon": app[repo].get("icon"), + } + ret.append(entry) return ret diff --git a/app/db.py b/app/db.py index 3e23dd5..fef8504 100644 --- a/app/db.py +++ b/app/db.py @@ -126,5 +126,23 @@ def get_json_key(key: str): return None -def get_app_count(): - return redis_conn.scard("apps:index") +def get_app_count(repo: str = "stable") -> int: + if repo == "stable_and_beta": + return len(get_apps(repo)) + if repo == "stable": + return redis_conn.scard("apps:index") + if repo == "beta": + return redis_conn.scard("apps:index_beta") + + +def get_apps(repo: str = "stable"): + if repo == "stable_and_beta": + apps = {app[5:] for app in redis_conn.smembers("apps:index")} + apps_beta = {app[5:] for app in redis_conn.smembers("apps:index_beta")} + return apps | apps_beta + elif repo == "stable": + apps = {app[5:] for app in redis_conn.smembers("apps:index")} + return apps + elif repo == "beta": + apps = {app[5:] for app in redis_conn.smembers("apps:index_beta")} + return apps diff --git a/app/feeds.py b/app/feeds.py index 54ec8ed..5bc695d 100644 --- a/app/feeds.py +++ b/app/feeds.py @@ -4,17 +4,27 @@ from . import db -def generate_feed(key: str, title: str, description: str, link: str): +def generate_feed( + key: str, + title: str, + description: str, + link: str, + repo: str, +): feed = FeedGenerator() feed.title(title) feed.description(description) feed.link(href=link) feed.language("en") - appids = db.redis_conn.zrevrange(key, 0, 10, withscores=True) - apps = [(db.get_json_key(f"apps:{appid[0]}"), appid[1]) for appid in appids] + # get 15, as we might have some that don't exist, due to summary knowing about consale-applications + appids = db.redis_conn.zrevrange(key, 0, 15, withscores=True) + app_score_tuple = [ + (db.get_json_key(f"apps:{appid[0]}"), appid[1]) for appid in appids + ] + apps = [(item[0][repo], item[1]) for item in app_score_tuple if item[0] is not None] - for app, timestamp in reversed(apps): + for app, timestamp in reversed(apps[:10]): if not app.get("name"): continue @@ -29,9 +39,7 @@ def generate_feed(key: str, title: str, description: str, link: str): entry.pubDate(f"{entry_date} UTC") content = [ - ''.format( - app["id"] - ), + ''.format(app["icon"]), f"

{app['summary']}

", f"

{app['description']}

", "

Additional information:

", @@ -63,19 +71,21 @@ def generate_feed(key: str, title: str, description: str, link: str): return feed.rss_str() -def get_recently_updated_apps_feed(): +def get_recently_updated_apps_feed(repo: str = "stable"): return generate_feed( - "recently_updated_zset", + "recently_updated_zset" if repo == "stable" else "recently_updated_beta_zset", "Flathub – recently updated applications", "Recently updated applications published on Flathub", "https://flathub.org/apps/collection/recently-updated", + repo, ) -def get_new_apps_feed(): +def get_new_apps_feed(repo: str = "stable"): return generate_feed( - "new_apps_zset", + "new_apps_zset" if repo == "stable" else "new_apps_beta_zset", "Flathub – recently added applications", "Applications recently published on Flathub", "https://flathub.org/apps/collection/new", + repo, ) diff --git a/app/main.py b/app/main.py index 207d577..bc334b4 100644 --- a/app/main.py +++ b/app/main.py @@ -22,7 +22,7 @@ def startup_event(): @app.post("/update") def update(): - new_apps = apps.load_appstream() + new_apps, new_apps_beta = apps.load_appstream() summary.update() picks.update() stats.update() @@ -31,9 +31,18 @@ def update(): new_apps_zset = {} for appid in new_apps: if metadata := db.get_json_key(f"summary:{appid}"): - new_apps_zset[appid] = metadata.get("timestamp", 0) + if "stable" in metadata: + new_apps_zset[appid] = metadata["stable"].get("timestamp", 0) db.redis_conn.zadd("new_apps_zset", new_apps_zset) + if new_apps_beta: + new_apps_beta_zset = {} + for appid in new_apps_beta: + if metadata := db.get_json_key(f"summary:{appid}"): + if "beta" in metadata: + new_apps_beta_zset[appid] = metadata["beta"].get("timestamp", 0) + db.redis_conn.zadd("new_apps_beta_zset", new_apps_beta_zset) + get_recently_updated.cache_clear() @@ -54,12 +63,15 @@ def get_category(category: schemas.Category): @app.get("/appstream") -def list_appstream(): - return apps.list_appstream() +def list_appstream(type: schemas.AppstreamType = "stable"): + return apps.list_appstream(type) @app.get("/appstream/{appid}", status_code=200) -def get_appstream(appid: str, response: Response): +def get_appstream( + appid: str, + response: Response, +): if value := db.get_json_key(f"apps:{appid}"): return value @@ -75,8 +87,8 @@ def search(userquery: str): @app.get("/collection/recently-updated") @app.get("/collection/recently-updated/{limit}") @lru_cache() -def get_recently_updated(limit: int = 100): - return apps.get_recently_updated(limit) +def get_recently_updated(limit: int = 100, type: schemas.AppstreamType = "stable"): + return apps.get_recently_updated(limit, type) @app.get("/picks/{pick}") @@ -98,15 +110,15 @@ def get_popular_days(days: int): @app.get("/feed/recently-updated") -def get_recently_updated_apps_feed(): +def get_recently_updated_apps_feed(type: schemas.AppstreamType = "stable"): return Response( - content=feeds.get_recently_updated_apps_feed(), media_type="application/rss+xml" + content=feeds.get_recently_updated_apps_feed(type), media_type="application/rss+xml" ) @app.get("/feed/new") -def get_new_apps_feed(): - return Response(content=feeds.get_new_apps_feed(), media_type="application/rss+xml") +def get_new_apps_feed(type: schemas.AppstreamType = "stable"): + return Response(content=feeds.get_new_apps_feed(type), media_type="application/rss+xml") @app.get("/status", status_code=200) diff --git a/app/schemas.py b/app/schemas.py index 516256b..971b5ea 100644 --- a/app/schemas.py +++ b/app/schemas.py @@ -14,3 +14,9 @@ class Category(str, Enum): Science = "Science" System = "System" Utility = "Utility" + + +class AppstreamType(str, Enum): + Stable = "stable" + Beta = "beta" + Stable_And_Beta = "stable_and_beta" diff --git a/app/summary.py b/app/summary.py index 4ecc669..5490157 100644 --- a/app/summary.py +++ b/app/summary.py @@ -25,7 +25,7 @@ def validate_ref(ref: str, enforce_arch=True): if enforce_arch and arch != "x86_64": return False - if branch != "stable": + if branch != "stable" and branch != "beta": return False return True @@ -91,9 +91,6 @@ def parse_metadata(ini: str): def update(): - summary_dict = defaultdict(lambda: {"arches": []}) - recently_updated_zset = {} - repo_file = Gio.File.new_for_path(f"{config.settings.flatpak_user_dir}/repo") repo = OSTree.Repo.new(repo_file) repo.open(None) @@ -103,6 +100,30 @@ def update(): GLib.VariantType.new(OSTree.SUMMARY_GVARIANT_STRING), summary, True ) + status_beta, summary_beta, signatures_beta = repo.remote_fetch_summary( + "flathub-beta", None + ) + data_beta = GLib.Variant.new_from_bytes( + GLib.VariantType.new(OSTree.SUMMARY_GVARIANT_STRING), summary_beta, True + ) + + summary_dict, recently_updated_zset = parse_summary_data(data) + summary_dict_beta, recently_updated_beta_zset = parse_summary_data(data_beta) + summary = merge_summary(summary_dict_beta, summary_dict) + + db.redis_conn.zadd("recently_updated_zset", recently_updated_zset) + db.redis_conn.zadd("recently_updated_beta_zset", recently_updated_beta_zset) + db.redis_conn.mset( + {f"summary:{appid}": json.dumps(summary[appid]) for appid in summary} + ) + + return len(recently_updated_zset), len(recently_updated_beta_zset) + + +def parse_summary_data(data): + summary_dict = defaultdict(lambda: {"arches": []}) + recently_updated_zset = {} + refs, metadata = data.unpack() xa_cache = metadata["xa.cache"] @@ -143,9 +164,21 @@ def update(): summary_dict[appid]["arches"].append(arch) - db.redis_conn.zadd("recently_updated_zset", recently_updated_zset) - db.redis_conn.mset( - {f"summary:{appid}": json.dumps(summary_dict[appid]) for appid in summary_dict} - ) + return summary_dict, recently_updated_zset + + +def merge_summary(summary_beta, summary_stable): + summary = {} + for appid in summary_stable: + summary[appid] = {"stable": summary_stable[appid]} + + for appid in summary_beta: + if appid not in summary: + summary[appid] = {"beta": summary_beta[appid]} + else: + summary[appid] = { + "stable": summary_stable[appid], + "beta": summary_beta[appid], + } - return len(recently_updated_zset) + return summary diff --git a/app/utils.py b/app/utils.py index 59afb0e..55a5524 100644 --- a/app/utils.py +++ b/app/utils.py @@ -7,7 +7,7 @@ from . import config -def appstream2dict(reponame: str): +def appstream2dict(reponame: str) -> dict[str, object]: if config.settings.appstream_repos is not None: appstream_path = os.path.join( config.settings.appstream_repos, diff --git a/tests/appstream/beta-repo/appstream/x86_64/appstream.xml b/tests/appstream/beta-repo/appstream/x86_64/appstream.xml new file mode 100644 index 0000000..646cf3e --- /dev/null +++ b/tests/appstream/beta-repo/appstream/x86_64/appstream.xml @@ -0,0 +1,223 @@ + + + + org.sugarlabs.Maze + org.sugarlabs.Maze + Maze + A simple maze game, but this is the beta version + Sugar Labs Community +

Good at finding your way out of hard situations? Let's see! Try to make your way through an increasingly difficult path.

+ org.sugarlabs.Maze.png + org.sugarlabs.Maze.png + + Game + + + HiDpiIcon + + GPL-3.0-or-later + https://github.com/sugarlabs/maze-activity + https://github.com/sugarlabs/maze-activity + + + https://i.imgur.com/imoTbzP.png + https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/624x351/org.sugarlabs.Maze-0cf71487936dec29c5b092662909f125.png + https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/112x63/org.sugarlabs.Maze-0cf71487936dec29c5b092662909f125.png + https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/224x126/org.sugarlabs.Maze-0cf71487936dec29c5b092662909f125.png + https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/752x423/org.sugarlabs.Maze-0cf71487936dec29c5b092662909f125.png + + + https://i.imgur.com/GO11pbh.png + https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/624x351/org.sugarlabs.Maze-4308958995b5f213eac85c7053e01a33.png + https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/112x63/org.sugarlabs.Maze-4308958995b5f213eac85c7053e01a33.png + https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/224x126/org.sugarlabs.Maze-4308958995b5f213eac85c7053e01a33.png + https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/752x423/org.sugarlabs.Maze-4308958995b5f213eac85c7053e01a33.png + + + https://i.imgur.com/RH1koq6.png + https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/624x351/org.sugarlabs.Maze-5d288daae5069cde2ffe86ab4a9285a7.png + https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/112x63/org.sugarlabs.Maze-5d288daae5069cde2ffe86ab4a9285a7.png + https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/224x126/org.sugarlabs.Maze-5d288daae5069cde2ffe86ab4a9285a7.png + https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/752x423/org.sugarlabs.Maze-5d288daae5069cde2ffe86ab4a9285a7.png + + + + + + + org.sugarlabs.Maze.desktop + + ach + am + an + ar + ayc + aym + ca + cs + da + de + el + en + en_GB + en_US + es + fa + fi + fr + gn + gug + he + hi + hu + hus + hy + id + it + ja + kab + km + ko + lt + mg + mi + ml + mn + ms + nah + ne + nl + pap + pbs + pl + pt + pt_BR + ro + ru + sk + sl + son + sq + sr + sv + sw + ta + te + th + uk + vi + zh_CN + zh_TW + + app/org.sugarlabs.Maze/x86_64/stable +
+ + com.only.in.beta.Repo + com.only.in.beta.Repo + Beta app + A simple beta test app + Developer + Developers, Developers, Developers, Developers + com.only.in.beta.Repo.png + com.only.in.beta.Repo.png + + Game + + + HiDpiIcon + + GPL-3.0-or-later + + + https://i.imgur.com/imoTbzP.png + https://dl.flathub.org/repo/screenshots/com.only.in.beta.Repo-stable/624x351/com.only.in.beta.Repo-0cf71487936dec29c5b092662909f125.png + https://dl.flathub.org/repo/screenshots/com.only.in.beta.Repo-stable/112x63/com.only.in.beta.Repo-0cf71487936dec29c5b092662909f125.png + https://dl.flathub.org/repo/screenshots/com.only.in.beta.Repo-stable/224x126/com.only.in.beta.Repo-0cf71487936dec29c5b092662909f125.png + https://dl.flathub.org/repo/screenshots/com.only.in.beta.Repo-stable/752x423/com.only.in.beta.Repo-0cf71487936dec29c5b092662909f125.png + + + https://i.imgur.com/GO11pbh.png + https://dl.flathub.org/repo/screenshots/com.only.in.beta.Repo-stable/624x351/com.only.in.beta.Repo-4308958995b5f213eac85c7053e01a33.png + https://dl.flathub.org/repo/screenshots/com.only.in.beta.Repo-stable/112x63/com.only.in.beta.Repo-4308958995b5f213eac85c7053e01a33.png + https://dl.flathub.org/repo/screenshots/com.only.in.beta.Repo-stable/224x126/com.only.in.beta.Repo-4308958995b5f213eac85c7053e01a33.png + https://dl.flathub.org/repo/screenshots/com.only.in.beta.Repo-stable/752x423/com.only.in.beta.Repo-4308958995b5f213eac85c7053e01a33.png + + + https://i.imgur.com/RH1koq6.png + https://dl.flathub.org/repo/screenshots/com.only.in.beta.Repo-stable/624x351/com.only.in.beta.Repo-5d288daae5069cde2ffe86ab4a9285a7.png + https://dl.flathub.org/repo/screenshots/com.only.in.beta.Repo-stable/112x63/com.only.in.beta.Repo-5d288daae5069cde2ffe86ab4a9285a7.png + https://dl.flathub.org/repo/screenshots/com.only.in.beta.Repo-stable/224x126/com.only.in.beta.Repo-5d288daae5069cde2ffe86ab4a9285a7.png + https://dl.flathub.org/repo/screenshots/com.only.in.beta.Repo-stable/752x423/com.only.in.beta.Repo-5d288daae5069cde2ffe86ab4a9285a7.png + + + + + + + com.only.in.beta.Repo.desktop + + ach + am + an + ar + ayc + aym + ca + cs + da + de + el + en + en_GB + en_US + es + fa + fi + fr + gn + gug + he + hi + hu + hus + hy + id + it + ja + kab + km + ko + lt + mg + mi + ml + mn + ms + nah + ne + nl + pap + pbs + pl + pt + pt_BR + ro + ru + sk + sl + son + sq + sr + sv + sw + ta + te + th + uk + vi + zh_CN + zh_TW + + app/com.only.in.beta.Repo/x86_64/stable + +
diff --git a/tests/main.py b/tests/main.py index 125c5f9..035edfb 100644 --- a/tests/main.py +++ b/tests/main.py @@ -40,6 +40,7 @@ def setup_module(): installation_path = os.path.join(workspace.name, "flatpak") repo_path = os.path.join(installation_path, "repo") + beta_repo_path = os.path.join(installation_path, "beta-repo") os.mkdir(installation_path) os.environ["FLATPAK_USER_DIR"] = installation_path @@ -50,6 +51,12 @@ def setup_module(): remote_path = os.path.join(os.getcwd(), "tests/ostree/repo") repo.remote_add("flathub", f"file://{remote_path}") + beta_file = Gio.File.new_for_path(beta_repo_path) + beta_repo = OSTree.Repo.new(beta_file) + beta_repo.create(OSTree.RepoMode.BARE, None) + beta_remote_path = os.path.join(os.getcwd(), "tests/ostree/beta-repo") + beta_repo.remote_add("flathub-beta", f"file://{beta_remote_path}") + for i, test_stats_json in enumerate( sorted(glob.glob("tests/stats/*.json"), reverse=True) ): @@ -97,6 +104,18 @@ def test_appstream_by_appid(): assert response.json() == _get_expected_json_result("test_appstream_by_appid") +def test_appstream_by_appid_stable_only(): + response = client.get("/appstream/com.anydesk.Anydesk") + assert response.status_code == 200 + assert response.json() == _get_expected_json_result("test_appstream_by_appid_stable_only") + + +def test_appstream_by_appid_beta_only(): + response = client.get("/appstream/com.only.in.beta.Repo") + assert response.status_code == 200 + assert response.json() == _get_expected_json_result("test_appstream_by_appid_beta_only") + + def test_appstream_by_non_existent_appid(): response = client.get("/appstream/NonExistent") assert response.status_code == 404 @@ -217,12 +236,44 @@ def test_list_appstream(): assert response.json() == _get_expected_json_result("test_list_appstream") -def test_summary_by_id(): +def test_list_appstream_explicit_stable(): + response = client.get("/appstream?type=stable") + assert response.status_code == 200 + assert response.json() == _get_expected_json_result("test_list_appstream") + + +def test_list_appstream_beta(): + response = client.get("/appstream?type=beta") + assert response.status_code == 200 + assert response.json() == _get_expected_json_result("test_list_appstream_beta") + + +def test_list_appstream_beta(): + response = client.get("/appstream?type=stable_and_beta") + assert response.status_code == 200 + assert response.json() == _get_expected_json_result( + "test_list_appstream_stable_and_beta" + ) + + +def test_summary_by_appid(): response = client.get("/summary/org.sugarlabs.Maze") assert response.status_code == 200 assert response.json() == _get_expected_json_result("test_summary_by_appid") +def test_summary_by_appid_stable_only(): + response = client.get("/summary/com.anydesk.Anydesk") + assert response.status_code == 200 + assert response.json() == _get_expected_json_result("test_summary_by_appid_stable_only") + + +def test_summary_by_appid_beta_only(): + response = client.get("/summary/com.only.in.beta.Repo") + assert response.status_code == 200 + assert response.json() == _get_expected_json_result("test_summary_by_appid_beta_only") + + def test_summary_by_non_existent_id(): response = client.get("/summary/does.not.exist") assert response.status_code == 404 diff --git a/tests/ostree/beta-repo/.lock b/tests/ostree/beta-repo/.lock new file mode 100644 index 0000000..e69de29 diff --git a/tests/ostree/beta-repo/config b/tests/ostree/beta-repo/config new file mode 100644 index 0000000..d289d74 --- /dev/null +++ b/tests/ostree/beta-repo/config @@ -0,0 +1,4 @@ +[core] +repo_version=1 +mode=archive-z2 +indexed-deltas=true diff --git a/tests/ostree/beta-repo/objects/06/e1f7778c81994966156b640349172066f6d932793bb61b728ca2b5d50ab4e3.dirtree b/tests/ostree/beta-repo/objects/06/e1f7778c81994966156b640349172066f6d932793bb61b728ca2b5d50ab4e3.dirtree new file mode 100644 index 0000000000000000000000000000000000000000..c5b544d98822001f2d4a172f06ee80499faabbeb GIT binary patch literal 49 zcmc~z%*#wmEiTc^D$dVi&}rv0E&UhFs&x6FL9gYK!wgp$*8fsDyy{WD=EmC4pk_XO F0|4>n6k-4X literal 0 HcmV?d00001 diff --git a/tests/ostree/beta-repo/objects/13/cf1de7f531b099bde97022106123028bb23e4e0f5f026a87e5fc08b6a81d32.filez b/tests/ostree/beta-repo/objects/13/cf1de7f531b099bde97022106123028bb23e4e0f5f026a87e5fc08b6a81d32.filez new file mode 100644 index 0000000000000000000000000000000000000000..390d748094c303e9e25b44beaf69c230ecd2baf7 GIT binary patch literal 244 zcmZQzV31;f14bV>lc8}5m@S#x=k0gIK)~gDahFDR$E`lu?K@dK<{bFjoS`;(qHsdv z4r|4RBOW>TSHD~J-TCsC#aqtCUjAfLnm>K%Zgc6#+q3mux6b)ldHrfb%Qa*f&bms*v-SCvXW|6KQQA@iPV(cewh?KVv{DHIFV7c`U* z;b=IxQIs!3v8$DFZo)~yn=||M(!M5oG%s!3C$C@hr~K~YWA)7S(G$1nd7RtrVY9)d k>E2V1+fs_E?2X2SY{y#8Ieok2yna^Egcpq)Y-?(m08(shC;$Ke literal 0 HcmV?d00001 diff --git a/tests/ostree/beta-repo/objects/17/3b903b7c28b40bb3d48e0ec347c36595d09cb3d799ca6d2f4f6cc16b2f9358.dirtree b/tests/ostree/beta-repo/objects/17/3b903b7c28b40bb3d48e0ec347c36595d09cb3d799ca6d2f4f6cc16b2f9358.dirtree new file mode 100644 index 0000000000000000000000000000000000000000..d743f61ace38ee1c4a589eba48efc5d1907364c3 GIT binary patch literal 191 zcmc~zElEsCEJ_Gv+1#S6Rd6wz`1%F1E?ImZrE3nRf8NIYwDtJA zciT#TEfKo8OgFwss-y(|7O~3f08QI>eX=a_Du&mxBW%3CX zE~S0DZ?YU=_2&(ZFTHww<*HZnUccJ7DpPK@N$n;b=g%c~e${*~_7vXx?#!lTHB+7S z-e11ezv*>xW#*QSJ5I0vT#H$kd39$``IE!#Qap_DNsJ@ zTZf-wBXdcc$wcSUc~?s_B!a(qxUDs}>ne?XVN&w5V$X*U?{}rk)iv&4J7c>Z$1$n- pE0w=VMhVy6yH+qQ=Rn{Ykw$|Bf#SN`FLbrMxDkCKV*b8*1^}B8aftu` literal 0 HcmV?d00001 diff --git a/tests/ostree/beta-repo/objects/3b/2099c61290dfb4fd31d5a081b64524102bb71d87d0c6fa70731d894b7a0a4b.filez b/tests/ostree/beta-repo/objects/3b/2099c61290dfb4fd31d5a081b64524102bb71d87d0c6fa70731d894b7a0a4b.filez new file mode 100644 index 0000000000000000000000000000000000000000..9f999cd7c782abdccdca713ee7b4e4ae5da4a63e GIT binary patch literal 123 zcmZQzV31-!fD#0=aS50$*9c_3Zhp+WH#TKKpy0_VIhF zrFB;OBul5*($`Bxmo8hjL@a&!6Y&?UPgJHYc`E+&Rd~dVqqAqekd}NQ8Brj*JSBMr LkKakRP!iGd%CmQVtMFvqgc!Q_@b4Mjox!|%RVrDmOATL>GD~Up*_DYbi0>u zamp+(UehVN>hq#J2jv-y+|9D~el(0WZ*e^A5Pvk(@BhB)J744v-w$1q%iXl`m@vQ2 myanbLFMo5>n9O*5q6Jg3!(zRtmkZBZx~Sh{O02H<&j0{xziE;H literal 0 HcmV?d00001 diff --git a/tests/ostree/beta-repo/objects/44/214b76684c64afc0308c62313ec14b253fd83c6e344811cab851e70d56f8de.commit b/tests/ostree/beta-repo/objects/44/214b76684c64afc0308c62313ec14b253fd83c6e344811cab851e70d56f8de.commit new file mode 100644 index 0000000000000000000000000000000000000000..28239f254f05405c8df27a4d049f50305e66ecc5 GIT binary patch literal 596 zcmb3xS%1=z>vV&6gRzEXv4g~$2pSb zSRGcU2`z~^ET$Et;gTJ+gAE(iO|(I#oshL SUUTP!bZ9XBVO+)74~76W9J|v1 literal 0 HcmV?d00001 diff --git a/tests/ostree/beta-repo/objects/44/6a0ef11b7cc167f3b603e585c7eeeeb675faa412d5ec73f62988eb0b6c5488.dirmeta b/tests/ostree/beta-repo/objects/44/6a0ef11b7cc167f3b603e585c7eeeeb675faa412d5ec73f62988eb0b6c5488.dirmeta new file mode 100644 index 0000000000000000000000000000000000000000..6757a41ee10d92270b1646be5433266cd6619e94 GIT binary patch literal 12 McmZQzfC0z100DaeF8}}l literal 0 HcmV?d00001 diff --git a/tests/ostree/beta-repo/objects/4b/1bbd9195d5d593e6bb103f8561c2cfa7ad59048722bb43de5847165cd332b0.filez b/tests/ostree/beta-repo/objects/4b/1bbd9195d5d593e6bb103f8561c2cfa7ad59048722bb43de5847165cd332b0.filez new file mode 100644 index 0000000000000000000000000000000000000000..d6ce9f8adc1d9f675b5f43fa825f9e9bce7f6f7c GIT binary patch literal 125 zcmZQzV31-!fJy|jaS50$*9c^{l?vb!|Ogf1OjFK3dm4 z`>yeNs-<;S`(%sPQqiT$mMsxWpZ-Mr1?v-)X-l4pKYbM*G2`g$nJ=UzUr0t2h%Qe_ NUcuvc(k+yQ0RY&;Ejj=I literal 0 HcmV?d00001 diff --git a/tests/ostree/beta-repo/objects/52/9106b1800fed122ab0cbc72ad603e9103f85ca69050a355a00ff4ac272f1e4.commit b/tests/ostree/beta-repo/objects/52/9106b1800fed122ab0cbc72ad603e9103f85ca69050a355a00ff4ac272f1e4.commit new file mode 100644 index 0000000000000000000000000000000000000000..bfeee92d9dbd637ffdb537e8042872904c21b493 GIT binary patch literal 588 zcmbCo!p5&o{9uRlmZ*EZ)pSA827x4$!J% zcBr{PJ*Wl}rC*gHu~-=50HD3OsU?Xii6x0(foR8qf}G6cM37Tsx$+WoQ*AMw!&Ow8 zSCR>pN(1^YCAB!aB)>o}ASbaTEx#xi=3XNMJp&7_;*@N#A;>C&Q?gMN0X@Y735S&Y z^1Ph>Len6*NVUgf+EK1I>Qh)>~ zms3$<9*7GGST3j1%$yR1^2`#TkQ>l11&P@ThI)oTUvNQ!3rr@kHhws&T~+w3s`Bo^ z#n--QM@;=y(dwM?g8hVyQ?^y%x;8c$mn^=I(lrOuKW}4x+IsxmyKSYvmIz&aQ~XV{ T<283qNQVN`C&q=0?O+H1Hs`r& literal 0 HcmV?d00001 diff --git a/tests/ostree/beta-repo/objects/57/ff61d7adf7fb37053348253b2f9588e6d2fce756b6e2ae4e228ae07206aff2.filez b/tests/ostree/beta-repo/objects/57/ff61d7adf7fb37053348253b2f9588e6d2fce756b6e2ae4e228ae07206aff2.filez new file mode 100644 index 0000000000000000000000000000000000000000..61766f41b69cd725b51c55a5c8385e7242ddf869 GIT binary patch literal 125 zcmZQzV31-!fKmjraS50$*9c)%V=_tJ?Y+*FO7upZ4*4 zs-<;S`y>n3bMd9Gmx?Z3wrq)5`t&E_FIb*`9dE;;}J literal 0 HcmV?d00001 diff --git a/tests/ostree/beta-repo/objects/6e/340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d.dirtree b/tests/ostree/beta-repo/objects/6e/340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d.dirtree new file mode 100644 index 0000000000000000000000000000000000000000..f76dd238ade08917e6712764a16a22005a50573d GIT binary patch literal 1 IcmZPo000310RR91 literal 0 HcmV?d00001 diff --git a/tests/ostree/beta-repo/objects/97/7b12b09e51e36c19376aa6f533fd6bab41fd275eb548f415f63bb639d783bd.dirtree b/tests/ostree/beta-repo/objects/97/7b12b09e51e36c19376aa6f533fd6bab41fd275eb548f415f63bb639d783bd.dirtree new file mode 100644 index 0000000000000000000000000000000000000000..43d8561293173a29f1cafa5051c73f2e8ea9ffdb GIT binary patch literal 191 zcmc~zElEsCEJ>IgL{*wW1)u zsDvTUgnQ2a%~dnzEOmLdyMjxnVuGywW^;?OR>8$=;_Da4x@7Tvl&(3L{&^eo)7Inf z-fb)WwM6LZo8oVp9k01_LORsh(=u~Xiy7D+elPE7oavb+nw`SzDXx(A?WR$s^)~6E To<&=)a&37`$Q(5`&xzUq8+BXd literal 0 HcmV?d00001 diff --git a/tests/ostree/beta-repo/objects/9f/5db1c17fcefa600b0c51b714526b5d57bb3fe8f71c39748b9cc291cc8e95aa.commit b/tests/ostree/beta-repo/objects/9f/5db1c17fcefa600b0c51b714526b5d57bb3fe8f71c39748b9cc291cc8e95aa.commit new file mode 100644 index 0000000000000000000000000000000000000000..763496ca8aae80bf408a340b3920aad2d1bc6c4a GIT binary patch literal 604 zcmb97D8YK|xMtaw5oyv0QnHxv93O&fqF4%`3?S z3g;K4>!ktxl#*JUU6Nm*7m$-!l9peT3v;KDfu4Z{S8+-|^j`EM{C5FO_pn&x=b;Dzwyl_gBN5kH6E^p4Xk zoP*i=lOtTR_&!S498CYbjrnQo@ptdGmHt{HboEW~H_eXM+&Li~224y$TN&pAVLc-N D(Z9YF literal 0 HcmV?d00001 diff --git a/tests/ostree/beta-repo/objects/9f/7128805558dbeafd19bb22ca51623eb494bb826d799888502f50d2353be399.dirtree b/tests/ostree/beta-repo/objects/9f/7128805558dbeafd19bb22ca51623eb494bb826d799888502f50d2353be399.dirtree new file mode 100644 index 0000000000000000000000000000000000000000..ad7f878449608925507cf4044bad32a0f1858523 GIT binary patch literal 49 zcmc~z%*#wmEiTc^D$dViu<5KWsQLe(I;JyghGEg&OP3#ijsHGB@KiI)iv;7Pb?$un F1^`3j7n1-0 literal 0 HcmV?d00001 diff --git a/tests/ostree/beta-repo/objects/a6/5f1a6cce2e4a0a161a55754bbbf5316cf1fb6726e77d64e984fd9cbe951712.commit b/tests/ostree/beta-repo/objects/a6/5f1a6cce2e4a0a161a55754bbbf5316cf1fb6726e77d64e984fd9cbe951712.commit new file mode 100644 index 0000000000000000000000000000000000000000..e0d49155835517d69cbda9aa8cc9d3a100851d2c GIT binary patch literal 572 zcmb97D8YK|xMtaw5oyv0QnHxv93O&fqF4%`3?S z3g;K4>!ktxl#*JUU6Nm*7m$-!l9peT3v;KDfu4Z{S8+-|^j`EM|1AD9A4=Q9yMfgCEe@R%n7;jz!5CRtk_n z!X%mZ;Dfyw1mnwe9gP@Y)=6mkRlqaZO`!BEc-=mRdOyFgR|YZH&S^#to0jV;`p zuk`U9c0Zgt^}?LZ*Jqx})%VXin5{oK!X=CEqjb%|^v~OvpSB)<_ikJ1uO&iP-xPn- U?0C(c6Vf5T^oVgPV?7uG0Co|t2LJ#7 literal 0 HcmV?d00001 diff --git a/tests/ostree/beta-repo/objects/af/e62d9d85075279e3d675fc4e9313fae814aeb2ec6110bfc3ba945d4759d996.filez b/tests/ostree/beta-repo/objects/af/e62d9d85075279e3d675fc4e9313fae814aeb2ec6110bfc3ba945d4759d996.filez new file mode 100644 index 0000000000000000000000000000000000000000..c251f2c09f5d8e93134a555bf6283be7c8c07c38 GIT binary patch literal 123 zcmZQzV31-!fGPyDaS50$*9c)%V=_tKMf;`*`Y}yH?zC zA;xuSrRq$FoqraU?A@~HO2~u+&$`Aq2frlGsJg&)b*-(DduDd-o7gz7ku|)~%dG9x KgDE*7t_%PMMlTTn literal 0 HcmV?d00001 diff --git a/tests/ostree/beta-repo/objects/bd/18589ad0b3b9ecbc1ad369f188536a40caf281a35f54f0f37390c71aef9d90.filez b/tests/ostree/beta-repo/objects/bd/18589ad0b3b9ecbc1ad369f188536a40caf281a35f54f0f37390c71aef9d90.filez new file mode 100644 index 0000000000000000000000000000000000000000..4fdeb61b6033047f44f5a011d7960f95eb992d7b GIT binary patch literal 242 zcmZQzV31;f14eH+lc8}5m@S#x=k0gcK*aTVtm_m*m-BtH_T|C~8<~FBDrC(K@oQjA zdfy_VqGh=E`9C{8-^+b>%#JUc>;1hhau@s6iA(nWR@=F(Gp=mc8qN9jPkvdgO`e#& z%C0=hHDcOjtN2~Vi=#@{Jv~KCj7hI6PyKyHVEOkAZ8X4=qSMas5%N|Nni}x4y(5z8`w#wirut?|Bn}-#mLe h?eg<2yv-hHq;)w+Tv*XPt@?$lQ^_0MlpOx~@c?4SXX*d| literal 0 HcmV?d00001 diff --git a/tests/ostree/beta-repo/objects/c5/2b7a71e67a79ddc1a3d6f42b5895fa78854364e807c81c426b3a71ae86061c.dirtree b/tests/ostree/beta-repo/objects/c5/2b7a71e67a79ddc1a3d6f42b5895fa78854364e807c81c426b3a71ae86061c.dirtree new file mode 100644 index 0000000000000000000000000000000000000000..bf77c1d59549930c3af37885f3a80defa0e1d747 GIT binary patch literal 191 zcmc~zElEsCEJeZ{0pY0Z~Z%sUOe)-x+mUgAx&i5kR#bPcSZQ#^OttiMZ zDq+Yo;hyt_Gv+1#S6Rd6wz`1%F1E?ImZrE3nRf8NIYwDtJA zciT#TEfKoWEB|=x<6o1p~c+H&?(xJ|tmYI`U%<$^dJl#D!b^I${t`)Uydw<~N>Dk@wt)D+@ U9O~D;^=;oo}ASbaTEx#xi=1wC6Jp&7_;*@L*mBA_5sEUA|;Q{(PCBHl`CqEHO zFfuUaGL#4^Gx#u6GwfyXV9aK8ttiMZDp5dj8iOCuwN|KNT#iM_8CD9Au;X$nO3VXs zAz{enRGOJnqEMb$0u*usI=>(>TftDz5a@6&a9AX;Hfevzo-LBXqmk?6Y-z;Fn7MSN zk@x9KspmfLmp3c<WEB|=x<6o1p~c+H&?(!s!V KgRzIP91H=~o~ug$ literal 0 HcmV?d00001 diff --git a/tests/ostree/beta-repo/refs/heads/app/com.anydesk.Anydesk/x86_64/stable b/tests/ostree/beta-repo/refs/heads/app/com.anydesk.Anydesk/x86_64/stable new file mode 100644 index 0000000..2d222a3 --- /dev/null +++ b/tests/ostree/beta-repo/refs/heads/app/com.anydesk.Anydesk/x86_64/stable @@ -0,0 +1 @@ +44214b76684c64afc0308c62313ec14b253fd83c6e344811cab851e70d56f8de diff --git a/tests/ostree/beta-repo/refs/heads/app/com.wps.Office/x86_64/stable b/tests/ostree/beta-repo/refs/heads/app/com.wps.Office/x86_64/stable new file mode 100644 index 0000000..f868faa --- /dev/null +++ b/tests/ostree/beta-repo/refs/heads/app/com.wps.Office/x86_64/stable @@ -0,0 +1 @@ +9f5db1c17fcefa600b0c51b714526b5d57bb3fe8f71c39748b9cc291cc8e95aa diff --git a/tests/ostree/beta-repo/refs/heads/app/org.sugarlabs.Maze/x86_64/stable b/tests/ostree/beta-repo/refs/heads/app/org.sugarlabs.Maze/x86_64/stable new file mode 100644 index 0000000..bdfe857 --- /dev/null +++ b/tests/ostree/beta-repo/refs/heads/app/org.sugarlabs.Maze/x86_64/stable @@ -0,0 +1 @@ +529106b1800fed122ab0cbc72ad603e9103f85ca69050a355a00ff4ac272f1e4 diff --git a/tests/ostree/beta-repo/summaries/2c7d1e349de7d0b20bb73cc76799ad6004833ab59d4111f55048c357b651ae12-386998efb2f56f8ba0981d9ad7184b34f99a23a91595f43df348f82cbc580437.delta b/tests/ostree/beta-repo/summaries/2c7d1e349de7d0b20bb73cc76799ad6004833ab59d4111f55048c357b651ae12-386998efb2f56f8ba0981d9ad7184b34f99a23a91595f43df348f82cbc580437.delta new file mode 100644 index 0000000000000000000000000000000000000000..18a63d8a72d0471d348907b01993b994c15f381d GIT binary patch literal 335 zcmV-V0kHlbiwFP!000021FJ|(Nn>GPVBlb4P~c)@V9;P-5CCF@#DW6-<6s}fk7;uuQUW^L9`V}ON2c|ozBe_C2*aw<8Q7Twm>C#=t}ZUk h%}p$-)GbRbDh9d{>TVEGDl9L?3;;1X7N|%9008fmlqLWG literal 0 HcmV?d00001 diff --git a/tests/ostree/beta-repo/summaries/2c7d1e349de7d0b20bb73cc76799ad6004833ab59d4111f55048c357b651ae12.gz b/tests/ostree/beta-repo/summaries/2c7d1e349de7d0b20bb73cc76799ad6004833ab59d4111f55048c357b651ae12.gz new file mode 100644 index 0000000000000000000000000000000000000000..0399c165a344baf349c9adfb7cdce8cd72ae19ee GIT binary patch literal 237 zcmV6A0`Gc2%5;Yv4Q`skk*FN$F;68zZ9@fQV9Ic`il(jBN-0G64VpR_$Hv literal 0 HcmV?d00001 diff --git a/tests/ostree/beta-repo/summaries/386998efb2f56f8ba0981d9ad7184b34f99a23a91595f43df348f82cbc580437.gz b/tests/ostree/beta-repo/summaries/386998efb2f56f8ba0981d9ad7184b34f99a23a91595f43df348f82cbc580437.gz new file mode 100644 index 0000000000000000000000000000000000000000..615352952a232781f5765d01b3732e07412f6d85 GIT binary patch literal 393 zcmV;40e1c$iwFP!0000014}F@&`-|K)l1B)Oi3-y)^mi=`V|&t@n$Ca#U+VJIjIZ` z3?WPmVBn(YU6$dKvi^WUPm-bCL2p(28#Z|+9)hQK1U}~t`*E)#Q7EXgm>3&=?h@V<=&pwOK=rArTr5 z@pe1p6OkPH|~^Vo^?FQn8+IVilG!@PYb2Xd>Ij2L87~ zS{qIu*Sg01Qoz3TR3wvecqtplhK%01>6a@?y*YMvwXaIs*Uz3J$f~ literal 0 HcmV?d00001 diff --git a/tests/ostree/beta-repo/summaries/76d192d80f282a6963af9782e9c2b6a5c7156f17a7137ebcf941d67157c4a690-386998efb2f56f8ba0981d9ad7184b34f99a23a91595f43df348f82cbc580437.delta b/tests/ostree/beta-repo/summaries/76d192d80f282a6963af9782e9c2b6a5c7156f17a7137ebcf941d67157c4a690-386998efb2f56f8ba0981d9ad7184b34f99a23a91595f43df348f82cbc580437.delta new file mode 100644 index 0000000000000000000000000000000000000000..9c3ce3e5d8862b811e7810fd7aadd466b85aad00 GIT binary patch literal 329 zcmV-P0k-}hiwFP!000021FJ|(Nn>YVVBlb6P|yI<7Z?}>fLK9*k%2)A$OdAC#DW6- zTM6aY6>Z%0RrZ|QYwpp7s)EHu*{+l1W@nHSAUkThif!jrbvSY({+rRiO zV_DKY=g`D6eN$KA@LwSg|CJXM>-ndpWhST6*lTG1^59@(XA)p$U;w(exHLC6v8YnF bEVZZ@=sKv2K}4yrycjb8m#;@BCISEeoHdpy literal 0 HcmV?d00001 diff --git a/tests/ostree/beta-repo/summaries/76d192d80f282a6963af9782e9c2b6a5c7156f17a7137ebcf941d67157c4a690.gz b/tests/ostree/beta-repo/summaries/76d192d80f282a6963af9782e9c2b6a5c7156f17a7137ebcf941d67157c4a690.gz new file mode 100644 index 0000000000000000000000000000000000000000..0254b4cdedddd5e69087e9caff5729ba1f243d81 GIT binary patch literal 319 zcmV-F0l@wriwFP!0000014}F@&`-|K)hjP3*7HwG%S=wyudpzSH#5;ME=f$vNo9Zn z8zu<7EM6+-oSqk#m{e$~_wKKTIUj$gt39txdD-%J&c3PQLKTU6DTyVCP+crgnz1n2 zv7jI)GdZy&Ge0kuD=#rO)fUxSuA#2Tf$#*uei*NNdCC<6764Ukcc_p2}q9GL2&R?{%o? z;}abIFUI13OlxTz1`HVC(D(ru4l_4vs51O#-~js&=>Fo;+}y;XO5L*5qGF(Hp*{c+ RrNZ(&OaNUD3K}v3005WMioXB= literal 0 HcmV?d00001 diff --git a/tests/ostree/beta-repo/summaries/94bee1ee1bbd230aba77f907dd105f97ffcfbd8347e0c80066eca80897422d3f-386998efb2f56f8ba0981d9ad7184b34f99a23a91595f43df348f82cbc580437.delta b/tests/ostree/beta-repo/summaries/94bee1ee1bbd230aba77f907dd105f97ffcfbd8347e0c80066eca80897422d3f-386998efb2f56f8ba0981d9ad7184b34f99a23a91595f43df348f82cbc580437.delta new file mode 100644 index 0000000000000000000000000000000000000000..24ddebfd1cc6222dcd6a4aff2650800c9e605cea GIT binary patch literal 261 zcmV+g0s8(QiwFP!000021FJ|(Nn>GPVBlb6P~c!T zM6aY6>Z%0RrZ|QYwpp7s)PUi_&LqIhzyNfAacORDVo{}TS!z)+(6vw>fQV9Ic`;@H LGN}hkN&x@>FhOy$ literal 0 HcmV?d00001 diff --git a/tests/ostree/beta-repo/summaries/94bee1ee1bbd230aba77f907dd105f97ffcfbd8347e0c80066eca80897422d3f.gz b/tests/ostree/beta-repo/summaries/94bee1ee1bbd230aba77f907dd105f97ffcfbd8347e0c80066eca80897422d3f.gz new file mode 100644 index 0000000000000000000000000000000000000000..7a58584084bb8a1aa4046d14e599f1493eaa0cdd GIT binary patch literal 320 zcmV-G0l)qqiwFP!0000014}F@&`-|K)hjP3*7HwG%S=wyudpzSH#5;ME=f$vNo9b7 z7$yikKX&86`g6Y$xOoD%iv(rIhVQn2@m4m1F{i^NZ5;(uz`3Q&NkwOY#f!0&)^d((;RP zVeT?A&@-^$Do)A9P#K((jjD)&L8GLkSd#bkLRuS6AJ@9Z{8GTa^;9M+muVEkf3HJD zAD`gxe=!#SV_Hk&Fkrw4hsF=UaG1GSLzUq_0|(fLK=&7y=H@0ARqB?d78L_s3-tkr SC>56HVFCc=FK3-H0ssJu$CaG` literal 0 HcmV?d00001 diff --git a/tests/ostree/beta-repo/summaries/da0308f06b33f241439b4717fcb6795bc17f80e2efbc0a7218dd087b40dbe348-386998efb2f56f8ba0981d9ad7184b34f99a23a91595f43df348f82cbc580437.delta b/tests/ostree/beta-repo/summaries/da0308f06b33f241439b4717fcb6795bc17f80e2efbc0a7218dd087b40dbe348-386998efb2f56f8ba0981d9ad7184b34f99a23a91595f43df348f82cbc580437.delta new file mode 100644 index 0000000000000000000000000000000000000000..b83aafa98dc69b22e6636d3580ceb323984ab335 GIT binary patch literal 336 zcmV-W0k8faiwFP!000021FJ|(N#kN*VBlb6P|yI<7Z?}>fLMVY$o>Ijb22h8XaZ>< zRsb>?5(^6Slk;=+67wokQj4?o93ixRg@swXnTdXJNn%n?Do|Yr69X8yD0-J=_@t~q zV9=9fXm`+C)&7P}o{5LxsU3mOdBc9(t4P#KNi0c(C}v=R(u~E?js*odnaPPInfZCK zTzQGPskT_GIh=D<)q@-Ar1LBhW61|dQsH+lKo8lNs*k*0kP-BRJ`fq;h#)I|eekE}81a21z z%8m`+ZU5rCjAcppoI?}O^i5rb!+(W1{8wI3tmmJWmYJMNW3Qq4%Y%cFok@V1fdS~= i;?msQ#G*>wvecqtpzEM61`(yg@?roh8NOaI0ssK#{GfpV literal 0 HcmV?d00001 diff --git a/tests/ostree/beta-repo/summaries/da0308f06b33f241439b4717fcb6795bc17f80e2efbc0a7218dd087b40dbe348.gz b/tests/ostree/beta-repo/summaries/da0308f06b33f241439b4717fcb6795bc17f80e2efbc0a7218dd087b40dbe348.gz new file mode 100644 index 0000000000000000000000000000000000000000..9fe133399bfb9d14178d8fd2e1ea2a7d72dce136 GIT binary patch literal 381 zcmV-@0fPP?iwFP!0000014}F@&`-|K)hjP3*7HwG%S=wyudpzSH#5;ME=f$vNo9Zn z8zu<7EM6+-oSqk#m{e$~_wKKTIUj$gt39txdD-%J&c3PQLKTU6DTyVCP+crgnz1n2 zv7jI)GdZy&Ge0kuD=#rO)fUxSuA=)O;2y5`&%36 z?-KVm{hFin^=Vw bvecqtplhK%01>6a@@&iiDysZ1DgyujLqWC; literal 0 HcmV?d00001 diff --git a/tests/ostree/beta-repo/summary b/tests/ostree/beta-repo/summary new file mode 100644 index 0000000000000000000000000000000000000000..a5218747cb610bb9ebbfb7db1b2c979d7501a508 GIT binary patch literal 1195 zcmYc+D9}&N&(%xJt4v8P&en5;(E1e?X7Oew`o$%QNja$u3=APmKmrI{6urwbd{WjQ zFz87#v^(gnYJbBf&%{IU)Q-UCykS4?M8>EdVuX!gxH&3l&)7?nx0sclbBSj=bKoC#cm&{y+IS%Ha76T71G*p z`nc9L=9dEYt*0_sxlE%N{(BuN`uGIDy^SBh_NtaKykkgX1bGOmzPL0uH?gQvFE>90 z6uLln6(wh6mZj=e88I*vi(sfL$$(=TTm3H z0TUW1&6eaB=mq2?mZaqu<-!t?k%69p1y^xOHipXJlx$Q*48YV#e0oH4cOedUBa$^u zoU91WKg6VCH1}c)XG~*g;%3z?4C##0Obm(D#Tq3g#hSGYWt+-e&g)Cm7P+tl*gLq-%eRnd3vY@h3;;+3wd5%9+f4eqj^$ zcAMkrGuI}tG+S+*>nQj&z~gZEw!n2l3JwVk3_!3%fqgTG&Mz)0N=?-(F3rtNEUMJY z%}+@M2{R-XC1+%orRr80F)$R1V5lp}&rK>W$t^QOicmFgFpgnQyfEyESO!9sF$3WoRO+q amReMtnV$z11QJXjMya4$NX_c=TNnUs_>i9f literal 0 HcmV?d00001 diff --git a/tests/results/test_appstream_by_appid.json b/tests/results/test_appstream_by_appid.json index ca55ff1..ee69d13 100644 --- a/tests/results/test_appstream_by_appid.json +++ b/tests/results/test_appstream_by_appid.json @@ -1,58 +1,118 @@ { - "description": "

Good at finding your way out of hard situations? Let's see! Try to make your way through an increasingly difficult path.

", - "screenshots": [ - { - "624x351": "https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/624x351/org.sugarlabs.Maze-4308958995b5f213eac85c7053e01a33.png", - "112x63": "https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/112x63/org.sugarlabs.Maze-4308958995b5f213eac85c7053e01a33.png", - "224x126": "https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/224x126/org.sugarlabs.Maze-4308958995b5f213eac85c7053e01a33.png", - "752x423": "https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/752x423/org.sugarlabs.Maze-4308958995b5f213eac85c7053e01a33.png" - }, - { - "624x351": "https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/624x351/org.sugarlabs.Maze-0cf71487936dec29c5b092662909f125.png", - "112x63": "https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/112x63/org.sugarlabs.Maze-0cf71487936dec29c5b092662909f125.png", - "224x126": "https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/224x126/org.sugarlabs.Maze-0cf71487936dec29c5b092662909f125.png", - "752x423": "https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/752x423/org.sugarlabs.Maze-0cf71487936dec29c5b092662909f125.png" - }, - { - "624x351": "https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/624x351/org.sugarlabs.Maze-5d288daae5069cde2ffe86ab4a9285a7.png", - "112x63": "https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/112x63/org.sugarlabs.Maze-5d288daae5069cde2ffe86ab4a9285a7.png", - "224x126": "https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/224x126/org.sugarlabs.Maze-5d288daae5069cde2ffe86ab4a9285a7.png", - "752x423": "https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/752x423/org.sugarlabs.Maze-5d288daae5069cde2ffe86ab4a9285a7.png" - } - ], - "releases": [ - { - "timestamp": "1582070400", - "version": "30" + "stable": { + "description": "

Good at finding your way out of hard situations? Let's see! Try to make your way through an increasingly difficult path.

", + "screenshots": [ + { + "624x351": "https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/624x351/org.sugarlabs.Maze-4308958995b5f213eac85c7053e01a33.png", + "112x63": "https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/112x63/org.sugarlabs.Maze-4308958995b5f213eac85c7053e01a33.png", + "224x126": "https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/224x126/org.sugarlabs.Maze-4308958995b5f213eac85c7053e01a33.png", + "752x423": "https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/752x423/org.sugarlabs.Maze-4308958995b5f213eac85c7053e01a33.png" + }, + { + "624x351": "https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/624x351/org.sugarlabs.Maze-0cf71487936dec29c5b092662909f125.png", + "112x63": "https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/112x63/org.sugarlabs.Maze-0cf71487936dec29c5b092662909f125.png", + "224x126": "https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/224x126/org.sugarlabs.Maze-0cf71487936dec29c5b092662909f125.png", + "752x423": "https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/752x423/org.sugarlabs.Maze-0cf71487936dec29c5b092662909f125.png" + }, + { + "624x351": "https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/624x351/org.sugarlabs.Maze-5d288daae5069cde2ffe86ab4a9285a7.png", + "112x63": "https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/112x63/org.sugarlabs.Maze-5d288daae5069cde2ffe86ab4a9285a7.png", + "224x126": "https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/224x126/org.sugarlabs.Maze-5d288daae5069cde2ffe86ab4a9285a7.png", + "752x423": "https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/752x423/org.sugarlabs.Maze-5d288daae5069cde2ffe86ab4a9285a7.png" + } + ], + "releases": [ + { + "timestamp": "1582070400", + "version": "30" + } + ], + "content_rating": { + "type": "oars-1.1" + }, + "urls": { + "bugtracker": "https://github.com/sugarlabs/maze-activity", + "homepage": "https://github.com/sugarlabs/maze-activity" + }, + "icon": "https://dl.flathub.org/repo/appstream/x86_64/icons/128x128/org.sugarlabs.Maze.png", + "id": "org.sugarlabs.Maze", + "translation": { + "value": "org.sugarlabs.Maze", + "type": "gettext" + }, + "name": "Maze", + "summary": "A simple maze game, but this is the beta version", + "developer_name": "Sugar Labs Community", + "categories": ["Game"], + "kudos": ["HiDpiIcon"], + "project_license": "GPL-3.0-or-later", + "launchable": { + "value": "org.sugarlabs.Maze.desktop", + "type": "desktop-id" + }, + "bundle": { + "value": "app/org.sugarlabs.Maze/x86_64/stable", + "type": "flatpak", + "runtime": "org.gnome.Platform/x86_64/3.36", + "sdk": "org.gnome.Sdk/x86_64/3.36" } - ], - "content_rating": { - "type": "oars-1.1" - }, - "urls": { - "bugtracker": "https://github.com/sugarlabs/maze-activity", - "homepage": "https://github.com/sugarlabs/maze-activity" - }, - "icon": "https://dl.flathub.org/repo/appstream/x86_64/icons/128x128/org.sugarlabs.Maze.png", - "id": "org.sugarlabs.Maze", - "translation": { - "value": "org.sugarlabs.Maze", - "type": "gettext" }, - "name": "Maze", - "summary": "A simple maze game", - "developer_name": "Sugar Labs Community", - "categories": ["Game"], - "kudos": ["HiDpiIcon"], - "project_license": "GPL-3.0-or-later", - "launchable": { - "value": "org.sugarlabs.Maze.desktop", - "type": "desktop-id" - }, - "bundle": { - "value": "app/org.sugarlabs.Maze/x86_64/stable", - "type": "flatpak", - "runtime": "org.gnome.Platform/x86_64/3.36", - "sdk": "org.gnome.Sdk/x86_64/3.36" + "beta": { + "description": "

Good at finding your way out of hard situations? Let's see! Try to make your way through an increasingly difficult path.

", + "screenshots": [ + { + "624x351": "https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/624x351/org.sugarlabs.Maze-4308958995b5f213eac85c7053e01a33.png", + "112x63": "https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/112x63/org.sugarlabs.Maze-4308958995b5f213eac85c7053e01a33.png", + "224x126": "https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/224x126/org.sugarlabs.Maze-4308958995b5f213eac85c7053e01a33.png", + "752x423": "https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/752x423/org.sugarlabs.Maze-4308958995b5f213eac85c7053e01a33.png" + }, + { + "624x351": "https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/624x351/org.sugarlabs.Maze-0cf71487936dec29c5b092662909f125.png", + "112x63": "https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/112x63/org.sugarlabs.Maze-0cf71487936dec29c5b092662909f125.png", + "224x126": "https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/224x126/org.sugarlabs.Maze-0cf71487936dec29c5b092662909f125.png", + "752x423": "https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/752x423/org.sugarlabs.Maze-0cf71487936dec29c5b092662909f125.png" + }, + { + "624x351": "https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/624x351/org.sugarlabs.Maze-5d288daae5069cde2ffe86ab4a9285a7.png", + "112x63": "https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/112x63/org.sugarlabs.Maze-5d288daae5069cde2ffe86ab4a9285a7.png", + "224x126": "https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/224x126/org.sugarlabs.Maze-5d288daae5069cde2ffe86ab4a9285a7.png", + "752x423": "https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/752x423/org.sugarlabs.Maze-5d288daae5069cde2ffe86ab4a9285a7.png" + } + ], + "releases": [ + { + "timestamp": "1582070400", + "version": "30" + } + ], + "content_rating": { + "type": "oars-1.1" + }, + "urls": { + "bugtracker": "https://github.com/sugarlabs/maze-activity", + "homepage": "https://github.com/sugarlabs/maze-activity" + }, + "icon": "https://dl.flathub.org/repo/appstream/x86_64/icons/128x128/org.sugarlabs.Maze.png", + "id": "org.sugarlabs.Maze", + "translation": { + "value": "org.sugarlabs.Maze", + "type": "gettext" + }, + "name": "Maze", + "summary": "A simple maze game, but this is the beta version", + "developer_name": "Sugar Labs Community", + "categories": ["Game"], + "kudos": ["HiDpiIcon"], + "project_license": "GPL-3.0-or-later", + "launchable": { + "value": "org.sugarlabs.Maze.desktop", + "type": "desktop-id" + }, + "bundle": { + "value": "app/org.sugarlabs.Maze/x86_64/stable", + "type": "flatpak", + "runtime": "org.gnome.Platform/x86_64/3.36", + "sdk": "org.gnome.Sdk/x86_64/3.36" + } } } diff --git a/tests/results/test_appstream_by_appid_beta_only.json b/tests/results/test_appstream_by_appid_beta_only.json new file mode 100644 index 0000000..54db110 --- /dev/null +++ b/tests/results/test_appstream_by_appid_beta_only.json @@ -0,0 +1,56 @@ +{ + "beta": { + "description": "Developers, Developers, Developers, Developers", + "screenshots": [ + { + "624x351": "https://dl.flathub.org/repo/screenshots/com.only.in.beta.Repo-stable/624x351/com.only.in.beta.Repo-4308958995b5f213eac85c7053e01a33.png", + "112x63": "https://dl.flathub.org/repo/screenshots/com.only.in.beta.Repo-stable/112x63/com.only.in.beta.Repo-4308958995b5f213eac85c7053e01a33.png", + "224x126": "https://dl.flathub.org/repo/screenshots/com.only.in.beta.Repo-stable/224x126/com.only.in.beta.Repo-4308958995b5f213eac85c7053e01a33.png", + "752x423": "https://dl.flathub.org/repo/screenshots/com.only.in.beta.Repo-stable/752x423/com.only.in.beta.Repo-4308958995b5f213eac85c7053e01a33.png" + }, + { + "624x351": "https://dl.flathub.org/repo/screenshots/com.only.in.beta.Repo-stable/624x351/com.only.in.beta.Repo-0cf71487936dec29c5b092662909f125.png", + "112x63": "https://dl.flathub.org/repo/screenshots/com.only.in.beta.Repo-stable/112x63/com.only.in.beta.Repo-0cf71487936dec29c5b092662909f125.png", + "224x126": "https://dl.flathub.org/repo/screenshots/com.only.in.beta.Repo-stable/224x126/com.only.in.beta.Repo-0cf71487936dec29c5b092662909f125.png", + "752x423": "https://dl.flathub.org/repo/screenshots/com.only.in.beta.Repo-stable/752x423/com.only.in.beta.Repo-0cf71487936dec29c5b092662909f125.png" + }, + { + "624x351": "https://dl.flathub.org/repo/screenshots/com.only.in.beta.Repo-stable/624x351/com.only.in.beta.Repo-5d288daae5069cde2ffe86ab4a9285a7.png", + "112x63": "https://dl.flathub.org/repo/screenshots/com.only.in.beta.Repo-stable/112x63/com.only.in.beta.Repo-5d288daae5069cde2ffe86ab4a9285a7.png", + "224x126": "https://dl.flathub.org/repo/screenshots/com.only.in.beta.Repo-stable/224x126/com.only.in.beta.Repo-5d288daae5069cde2ffe86ab4a9285a7.png", + "752x423": "https://dl.flathub.org/repo/screenshots/com.only.in.beta.Repo-stable/752x423/com.only.in.beta.Repo-5d288daae5069cde2ffe86ab4a9285a7.png" + } + ], + "releases": [ + { + "timestamp": "1582070400", + "version": "30" + } + ], + "content_rating": { + "type": "oars-1.1" + }, + "icon": "https://dl.flathub.org/repo/appstream/x86_64/icons/128x128/com.only.in.beta.Repo.png", + "id": "com.only.in.beta.Repo", + "translation": { + "value": "com.only.in.beta.Repo", + "type": "gettext" + }, + "name": "Beta app", + "summary": "A simple beta test app", + "developer_name": "Developer", + "categories": ["Game"], + "kudos": ["HiDpiIcon"], + "project_license": "GPL-3.0-or-later", + "launchable": { + "value": "com.only.in.beta.Repo.desktop", + "type": "desktop-id" + }, + "bundle": { + "value": "app/com.only.in.beta.Repo/x86_64/stable", + "type": "flatpak", + "runtime": "org.gnome.Platform/x86_64/3.36", + "sdk": "org.gnome.Sdk/x86_64/3.36" + } + } +} diff --git a/tests/results/test_appstream_by_appid_stable_only.json b/tests/results/test_appstream_by_appid_stable_only.json new file mode 100644 index 0000000..ff95a6a --- /dev/null +++ b/tests/results/test_appstream_by_appid_stable_only.json @@ -0,0 +1,112 @@ +{ + "stable": { + "description": "

AnyDesk ensures secure and reliable remote desktop connections for IT professionals and on-the-go individuals alike.

NOTE: This wrapper is not verified by, affiliated with, or supported by AnyDesk.

", + "screenshots": [ + { + "624x351": "https://dl.flathub.org/repo/screenshots/com.anydesk.Anydesk-stable/624x351/com.anydesk.Anydesk-b8f4a58c33a1e1603bad8a835f244173.png", + "112x63": "https://dl.flathub.org/repo/screenshots/com.anydesk.Anydesk-stable/112x63/com.anydesk.Anydesk-b8f4a58c33a1e1603bad8a835f244173.png", + "224x126": "https://dl.flathub.org/repo/screenshots/com.anydesk.Anydesk-stable/224x126/com.anydesk.Anydesk-b8f4a58c33a1e1603bad8a835f244173.png", + "752x423": "https://dl.flathub.org/repo/screenshots/com.anydesk.Anydesk-stable/752x423/com.anydesk.Anydesk-b8f4a58c33a1e1603bad8a835f244173.png" + } + ], + "releases": [ + { + "timestamp": "1598313600", + "version": "6.0.1" + }, + { + "timestamp": "1595894400", + "version": "6.0.0" + }, + { + "timestamp": "1588896000", + "version": "5.5.6" + }, + { + "timestamp": "1587340800", + "version": "5.5.5" + }, + { + "timestamp": "1582588800", + "version": "5.5.4" + }, + { + "timestamp": "1582243200", + "version": "5.5.3" + }, + { + "timestamp": "1581897600", + "version": "5.5.2" + }, + { + "timestamp": "1575331200", + "version": "5.5.1" + }, + { + "timestamp": "1574035200", + "version": "5.5.0" + }, + { + "timestamp": "1572480000", + "version": "5.4.1" + }, + { + "timestamp": "1571875200", + "version": "5.4.0" + }, + { + "timestamp": "1566345600", + "version": "5.1.2" + }, + { + "timestamp": "1560384000", + "version": "5.1.1" + }, + { + "timestamp": "1541721600", + "version": "4.0.1" + }, + { + "timestamp": "1537142400", + "version": "4.0.0" + }, + { + "timestamp": "1528934400", + "version": "2.9.6" + }, + { + "timestamp": "1505347200", + "version": "2.9.5" + } + ], + "content_rating": { + "type": "oars-1.1" + }, + "urls": { + "bugtracker": "https://github.com/flathub/com.anydesk.Anydesk/issues", + "homepage": "https://www.anydesk.com" + }, + "icon": "https://lh3.googleusercontent.com/bpm79oQCS4VMwIG-jajHfpsIhsUodP5fHDa3V2cMXLiwkSscAAviezm9YlmSxgjkB-A=w128", + "id": "com.anydesk.Anydesk", + "translation": { + "value": "com.anydesk.Anydesk", + "type": "gettext" + }, + "name": "AnyDesk", + "summary": "Connect to a computer remotely", + "developer_name": "AnyDesk Software GmbH", + "categories": ["Network"], + "kudos": ["HiDpiIcon"], + "project_license": "LicenseRef-proprietary", + "launchable": { + "value": "com.anydesk.Anydesk.desktop", + "type": "desktop-id" + }, + "bundle": { + "value": "app/com.anydesk.Anydesk/x86_64/stable", + "type": "flatpak", + "runtime": "org.freedesktop.Platform/x86_64/20.08", + "sdk": "org.freedesktop.Sdk/x86_64/20.08" + } + } +} diff --git a/tests/results/test_list_appstream_beta.json b/tests/results/test_list_appstream_beta.json new file mode 100644 index 0000000..82fa84d --- /dev/null +++ b/tests/results/test_list_appstream_beta.json @@ -0,0 +1 @@ +["org.sugarlabs.Maze"] diff --git a/tests/results/test_list_appstream_stable_and_beta.json b/tests/results/test_list_appstream_stable_and_beta.json new file mode 100644 index 0000000..d46dae1 --- /dev/null +++ b/tests/results/test_list_appstream_stable_and_beta.json @@ -0,0 +1,6 @@ +[ + "com.anydesk.Anydesk", + "com.wps.Office", + "org.sugarlabs.Maze", + "com.only.in.beta.Repo" +] diff --git a/tests/results/test_summary_by_appid.json b/tests/results/test_summary_by_appid.json index a9d1ba4..1cae29d 100644 --- a/tests/results/test_summary_by_appid.json +++ b/tests/results/test_summary_by_appid.json @@ -1,14 +1,26 @@ { - "arches": [ - "x86_64" - ], - "timestamp": 1610973680, - "download_size": 1024, - "installed_size": 371, - "metadata": { - "name": "org.sugarlabs.Maze", - "runtime": "org.freedesktop.Platform/x86_64/20.08", - "sdk": "org.freedesktop.Sdk/x86_64/20.08", - "permissions": {} + "stable": { + "arches": ["x86_64"], + "timestamp": 1610973680, + "download_size": 1024, + "installed_size": 371, + "metadata": { + "name": "org.sugarlabs.Maze", + "runtime": "org.freedesktop.Platform/x86_64/20.08", + "sdk": "org.freedesktop.Sdk/x86_64/20.08", + "permissions": {} + } + }, + "beta": { + "arches": ["x86_64"], + "timestamp": 1610973680, + "download_size": 1024, + "installed_size": 371, + "metadata": { + "name": "org.sugarlabs.Maze", + "runtime": "org.freedesktop.Platform/x86_64/20.08", + "sdk": "org.freedesktop.Sdk/x86_64/20.08", + "permissions": {} + } } } diff --git a/tests/results/test_summary_by_appid_beta_only.json b/tests/results/test_summary_by_appid_beta_only.json new file mode 100644 index 0000000..0ecb4a6 --- /dev/null +++ b/tests/results/test_summary_by_appid_beta_only.json @@ -0,0 +1,14 @@ +{ + "beta": { + "arches": ["x86_64"], + "timestamp": 1610973680, + "download_size": 1024, + "installed_size": 371, + "metadata": { + "name": "com.only.in.beta.Repo", + "runtime": "org.freedesktop.Platform/x86_64/20.08", + "sdk": "org.freedesktop.Sdk/x86_64/20.08", + "permissions": {} + } + } +} diff --git a/tests/results/test_summary_by_appid_stable_only.json b/tests/results/test_summary_by_appid_stable_only.json new file mode 100644 index 0000000..e0e5764 --- /dev/null +++ b/tests/results/test_summary_by_appid_stable_only.json @@ -0,0 +1,14 @@ +{ + "stable": { + "arches": ["x86_64"], + "timestamp": 1610973680, + "download_size": 1024, + "installed_size": 371, + "metadata": { + "name": "org.sugarlabs.Maze", + "runtime": "org.freedesktop.Platform/x86_64/20.08", + "sdk": "org.freedesktop.Sdk/x86_64/20.08", + "permissions": {} + } + } +} From 567665ce0c5f38597f451d6d780e6d78a2e62207 Mon Sep 17 00:00:00 2001 From: Kolja Lampe Date: Sat, 4 Dec 2021 12:48:11 +0100 Subject: [PATCH 2/3] Fix most of the tests --- app/summary.py | 30 +++++------ app/utils.py | 6 +-- .../beta-repo/appstream/x86_64/appstream.xml | 2 +- tests/main.py | 24 +++++---- tests/ostree/beta-repo/.lock | 0 tests/ostree/beta-repo/config | 4 -- ...2066f6d932793bb61b728ca2b5d50ab4e3.dirtree | Bin 49 -> 0 bytes ...23028bb23e4e0f5f026a87e5fc08b6a81d32.filez | Bin 244 -> 0 bytes ...6595d09cb3d799ca6d2f4f6cc16b2f9358.dirtree | Bin 191 -> 0 bytes ...a4c300d500affa24c3aae26f29b17d555283.filez | Bin 248 -> 0 bytes ...4524102bb71d87d0c6fa70731d894b7a0a4b.filez | Bin 123 -> 0 bytes ...ddd2d3e3f55ff79f51ca8304e86033a57e47.filez | Bin 246 -> 0 bytes ...14b253fd83c6e344811cab851e70d56f8de.commit | Bin 596 -> 0 bytes ...eeb675faa412d5ec73f62988eb0b6c5488.dirmeta | Bin 12 -> 0 bytes ...c2cfa7ad59048722bb43de5847165cd332b0.filez | Bin 125 -> 0 bytes ...3e9103f85ca69050a355a00ff4ac272f1e4.commit | Bin 588 -> 0 bytes ...9588e6d2fce756b6e2ae4e228ae07206aff2.filez | Bin 125 -> 0 bytes ...2c78901d3fb33738768511a30617afa01d.dirtree | Bin 1 -> 0 bytes ...6bab41fd275eb548f415f63bb639d783bd.dirtree | Bin 191 -> 0 bytes ...b5d57bb3fe8f71c39748b9cc291cc8e95aa.commit | Bin 604 -> 0 bytes ...3eb494bb826d799888502f50d2353be399.dirtree | Bin 49 -> 0 bytes ...5316cf1fb6726e77d64e984fd9cbe951712.commit | Bin 572 -> 0 bytes ...13fae814aeb2ec6110bfc3ba945d4759d996.filez | Bin 123 -> 0 bytes ...536a40caf281a35f54f0f37390c71aef9d90.filez | Bin 242 -> 0 bytes ...fa78854364e807c81c426b3a71ae86061c.dirtree | Bin 191 -> 0 bytes ...fccba97e932cbe6cf493e38b84b078a7ee.dirtree | Bin 49 -> 0 bytes ...c0e9cb9b8b8785f3f328c28f2bdaf6beed.dirtree | Bin 49 -> 0 bytes ...a5a9324bcbd265cef3bf1f3674f24dc92f.dirtree | Bin 191 -> 0 bytes ...dbe7fffb57727d01b710ade20d027345e07.commit | Bin 556 -> 0 bytes .../app/com.anydesk.Anydesk/x86_64/stable | 1 - .../heads/app/com.wps.Office/x86_64/stable | 1 - .../app/org.sugarlabs.Maze/x86_64/stable | 1 - ...4b34f99a23a91595f43df348f82cbc580437.delta | Bin 335 -> 0 bytes ...799ad6004833ab59d4111f55048c357b651ae12.gz | Bin 237 -> 0 bytes ...7184b34f99a23a91595f43df348f82cbc580437.gz | Bin 393 -> 0 bytes ...4b34f99a23a91595f43df348f82cbc580437.delta | Bin 329 -> 0 bytes ...9c2b6a5c7156f17a7137ebcf941d67157c4a690.gz | Bin 319 -> 0 bytes ...4b34f99a23a91595f43df348f82cbc580437.delta | Bin 261 -> 0 bytes ...d105f97ffcfbd8347e0c80066eca80897422d3f.gz | Bin 320 -> 0 bytes ...4b34f99a23a91595f43df348f82cbc580437.delta | Bin 336 -> 0 bytes ...cb6795bc17f80e2efbc0a7218dd087b40dbe348.gz | Bin 381 -> 0 bytes tests/ostree/beta-repo/summary | Bin 1195 -> 0 bytes tests/ostree/beta-repo/summary.idx | Bin 398 -> 0 bytes tests/results/test_appstream_by_appid.json | 6 +-- .../test_appstream_by_appid_beta_only.json | 12 +++-- .../test_appstream_by_appid_stable_only.json | 48 ++++++++++++++---- tests/results/test_feed_by_new.xml | 2 +- .../results/test_feed_by_recently_updated.xml | 2 +- .../test_list_appstream_stable_and_beta.json | 4 +- tests/results/test_summary_by_appid.json | 4 +- .../test_summary_by_appid_stable_only.json | 10 ++-- 51 files changed, 94 insertions(+), 63 deletions(-) delete mode 100644 tests/ostree/beta-repo/.lock delete mode 100644 tests/ostree/beta-repo/config delete mode 100644 tests/ostree/beta-repo/objects/06/e1f7778c81994966156b640349172066f6d932793bb61b728ca2b5d50ab4e3.dirtree delete mode 100644 tests/ostree/beta-repo/objects/13/cf1de7f531b099bde97022106123028bb23e4e0f5f026a87e5fc08b6a81d32.filez delete mode 100644 tests/ostree/beta-repo/objects/17/3b903b7c28b40bb3d48e0ec347c36595d09cb3d799ca6d2f4f6cc16b2f9358.dirtree delete mode 100644 tests/ostree/beta-repo/objects/2c/870e3575fe530522d3c1308d39a4c300d500affa24c3aae26f29b17d555283.filez delete mode 100644 tests/ostree/beta-repo/objects/3b/2099c61290dfb4fd31d5a081b64524102bb71d87d0c6fa70731d894b7a0a4b.filez delete mode 100644 tests/ostree/beta-repo/objects/3c/897b707cffe07b5c896a983172ddd2d3e3f55ff79f51ca8304e86033a57e47.filez delete mode 100644 tests/ostree/beta-repo/objects/44/214b76684c64afc0308c62313ec14b253fd83c6e344811cab851e70d56f8de.commit delete mode 100644 tests/ostree/beta-repo/objects/44/6a0ef11b7cc167f3b603e585c7eeeeb675faa412d5ec73f62988eb0b6c5488.dirmeta delete mode 100644 tests/ostree/beta-repo/objects/4b/1bbd9195d5d593e6bb103f8561c2cfa7ad59048722bb43de5847165cd332b0.filez delete mode 100644 tests/ostree/beta-repo/objects/52/9106b1800fed122ab0cbc72ad603e9103f85ca69050a355a00ff4ac272f1e4.commit delete mode 100644 tests/ostree/beta-repo/objects/57/ff61d7adf7fb37053348253b2f9588e6d2fce756b6e2ae4e228ae07206aff2.filez delete mode 100644 tests/ostree/beta-repo/objects/6e/340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d.dirtree delete mode 100644 tests/ostree/beta-repo/objects/97/7b12b09e51e36c19376aa6f533fd6bab41fd275eb548f415f63bb639d783bd.dirtree delete mode 100644 tests/ostree/beta-repo/objects/9f/5db1c17fcefa600b0c51b714526b5d57bb3fe8f71c39748b9cc291cc8e95aa.commit delete mode 100644 tests/ostree/beta-repo/objects/9f/7128805558dbeafd19bb22ca51623eb494bb826d799888502f50d2353be399.dirtree delete mode 100644 tests/ostree/beta-repo/objects/a6/5f1a6cce2e4a0a161a55754bbbf5316cf1fb6726e77d64e984fd9cbe951712.commit delete mode 100644 tests/ostree/beta-repo/objects/af/e62d9d85075279e3d675fc4e9313fae814aeb2ec6110bfc3ba945d4759d996.filez delete mode 100644 tests/ostree/beta-repo/objects/bd/18589ad0b3b9ecbc1ad369f188536a40caf281a35f54f0f37390c71aef9d90.filez delete mode 100644 tests/ostree/beta-repo/objects/c5/2b7a71e67a79ddc1a3d6f42b5895fa78854364e807c81c426b3a71ae86061c.dirtree delete mode 100644 tests/ostree/beta-repo/objects/e5/6d2aea757ab43320c72f3d502fcbfccba97e932cbe6cf493e38b84b078a7ee.dirtree delete mode 100644 tests/ostree/beta-repo/objects/ea/f29e2dbc0c7e0fa8e9ad153d86efc0e9cb9b8b8785f3f328c28f2bdaf6beed.dirtree delete mode 100644 tests/ostree/beta-repo/objects/f0/6b9b14640c286d42433932090169a5a9324bcbd265cef3bf1f3674f24dc92f.dirtree delete mode 100644 tests/ostree/beta-repo/objects/ff/dfe498fb7016c4282e5369534a3dbe7fffb57727d01b710ade20d027345e07.commit delete mode 100644 tests/ostree/beta-repo/refs/heads/app/com.anydesk.Anydesk/x86_64/stable delete mode 100644 tests/ostree/beta-repo/refs/heads/app/com.wps.Office/x86_64/stable delete mode 100644 tests/ostree/beta-repo/refs/heads/app/org.sugarlabs.Maze/x86_64/stable delete mode 100644 tests/ostree/beta-repo/summaries/2c7d1e349de7d0b20bb73cc76799ad6004833ab59d4111f55048c357b651ae12-386998efb2f56f8ba0981d9ad7184b34f99a23a91595f43df348f82cbc580437.delta delete mode 100644 tests/ostree/beta-repo/summaries/2c7d1e349de7d0b20bb73cc76799ad6004833ab59d4111f55048c357b651ae12.gz delete mode 100644 tests/ostree/beta-repo/summaries/386998efb2f56f8ba0981d9ad7184b34f99a23a91595f43df348f82cbc580437.gz delete mode 100644 tests/ostree/beta-repo/summaries/76d192d80f282a6963af9782e9c2b6a5c7156f17a7137ebcf941d67157c4a690-386998efb2f56f8ba0981d9ad7184b34f99a23a91595f43df348f82cbc580437.delta delete mode 100644 tests/ostree/beta-repo/summaries/76d192d80f282a6963af9782e9c2b6a5c7156f17a7137ebcf941d67157c4a690.gz delete mode 100644 tests/ostree/beta-repo/summaries/94bee1ee1bbd230aba77f907dd105f97ffcfbd8347e0c80066eca80897422d3f-386998efb2f56f8ba0981d9ad7184b34f99a23a91595f43df348f82cbc580437.delta delete mode 100644 tests/ostree/beta-repo/summaries/94bee1ee1bbd230aba77f907dd105f97ffcfbd8347e0c80066eca80897422d3f.gz delete mode 100644 tests/ostree/beta-repo/summaries/da0308f06b33f241439b4717fcb6795bc17f80e2efbc0a7218dd087b40dbe348-386998efb2f56f8ba0981d9ad7184b34f99a23a91595f43df348f82cbc580437.delta delete mode 100644 tests/ostree/beta-repo/summaries/da0308f06b33f241439b4717fcb6795bc17f80e2efbc0a7218dd087b40dbe348.gz delete mode 100644 tests/ostree/beta-repo/summary delete mode 100644 tests/ostree/beta-repo/summary.idx diff --git a/app/summary.py b/app/summary.py index 5490157..17932c1 100644 --- a/app/summary.py +++ b/app/summary.py @@ -91,21 +91,8 @@ def parse_metadata(ini: str): def update(): - repo_file = Gio.File.new_for_path(f"{config.settings.flatpak_user_dir}/repo") - repo = OSTree.Repo.new(repo_file) - repo.open(None) - - status, summary, signatures = repo.remote_fetch_summary("flathub", None) - data = GLib.Variant.new_from_bytes( - GLib.VariantType.new(OSTree.SUMMARY_GVARIANT_STRING), summary, True - ) - - status_beta, summary_beta, signatures_beta = repo.remote_fetch_summary( - "flathub-beta", None - ) - data_beta = GLib.Variant.new_from_bytes( - GLib.VariantType.new(OSTree.SUMMARY_GVARIANT_STRING), summary_beta, True - ) + data = get_summary_data("flathub") + data_beta = get_summary_data("flathub-beta") summary_dict, recently_updated_zset = parse_summary_data(data) summary_dict_beta, recently_updated_beta_zset = parse_summary_data(data_beta) @@ -120,6 +107,19 @@ def update(): return len(recently_updated_zset), len(recently_updated_beta_zset) +def get_summary_data(remote_name): + repo_file = Gio.File.new_for_path(f"{config.settings.flatpak_user_dir}/repo") + repo = OSTree.Repo.new(repo_file) + repo.open(None) + + status, summary, signatures = repo.remote_fetch_summary(remote_name, None) + data = GLib.Variant.new_from_bytes( + GLib.VariantType.new(OSTree.SUMMARY_GVARIANT_STRING), summary, True + ) + + return data + + def parse_summary_data(data): summary_dict = defaultdict(lambda: {"arches": []}) recently_updated_zset = {} diff --git a/app/utils.py b/app/utils.py index 55a5524..f10ccf2 100644 --- a/app/utils.py +++ b/app/utils.py @@ -7,11 +7,11 @@ from . import config -def appstream2dict(reponame: str) -> dict[str, object]: +def appstream2dict(repo_name: str) -> dict[str, object]: if config.settings.appstream_repos is not None: appstream_path = os.path.join( config.settings.appstream_repos, - reponame, + repo_name, "appstream", "x86_64", "appstream.xml", @@ -23,7 +23,7 @@ def appstream2dict(reponame: str) -> dict[str, object]: appstream = file.read() else: appstream_url = ( - f"https://hub.flathub.org/{reponame}/appstream/x86_64/appstream.xml.gz" + f"https://hub.flathub.org/{repo_name}/appstream/x86_64/appstream.xml.gz" ) r = requests.get(appstream_url, stream=True) appstream = gzip.decompress(r.raw.data) diff --git a/tests/appstream/beta-repo/appstream/x86_64/appstream.xml b/tests/appstream/beta-repo/appstream/x86_64/appstream.xml index 646cf3e..9648a39 100644 --- a/tests/appstream/beta-repo/appstream/x86_64/appstream.xml +++ b/tests/appstream/beta-repo/appstream/x86_64/appstream.xml @@ -117,7 +117,7 @@ Beta app A simple beta test app Developer - Developers, Developers, Developers, Developers +

Developers, Developers, Developers, Developers

com.only.in.beta.Repo.png com.only.in.beta.Repo.png diff --git a/tests/main.py b/tests/main.py index 035edfb..62452f1 100644 --- a/tests/main.py +++ b/tests/main.py @@ -40,7 +40,6 @@ def setup_module(): installation_path = os.path.join(workspace.name, "flatpak") repo_path = os.path.join(installation_path, "repo") - beta_repo_path = os.path.join(installation_path, "beta-repo") os.mkdir(installation_path) os.environ["FLATPAK_USER_DIR"] = installation_path @@ -50,12 +49,7 @@ def setup_module(): repo.create(OSTree.RepoMode.BARE, None) remote_path = os.path.join(os.getcwd(), "tests/ostree/repo") repo.remote_add("flathub", f"file://{remote_path}") - - beta_file = Gio.File.new_for_path(beta_repo_path) - beta_repo = OSTree.Repo.new(beta_file) - beta_repo.create(OSTree.RepoMode.BARE, None) - beta_remote_path = os.path.join(os.getcwd(), "tests/ostree/beta-repo") - beta_repo.remote_add("flathub-beta", f"file://{beta_remote_path}") + repo.remote_add("flathub-beta", f"file://{remote_path}") for i, test_stats_json in enumerate( sorted(glob.glob("tests/stats/*.json"), reverse=True) @@ -107,13 +101,17 @@ def test_appstream_by_appid(): def test_appstream_by_appid_stable_only(): response = client.get("/appstream/com.anydesk.Anydesk") assert response.status_code == 200 - assert response.json() == _get_expected_json_result("test_appstream_by_appid_stable_only") + assert response.json() == _get_expected_json_result( + "test_appstream_by_appid_stable_only" + ) def test_appstream_by_appid_beta_only(): response = client.get("/appstream/com.only.in.beta.Repo") assert response.status_code == 200 - assert response.json() == _get_expected_json_result("test_appstream_by_appid_beta_only") + assert response.json() == _get_expected_json_result( + "test_appstream_by_appid_beta_only" + ) def test_appstream_by_non_existent_appid(): @@ -265,13 +263,17 @@ def test_summary_by_appid(): def test_summary_by_appid_stable_only(): response = client.get("/summary/com.anydesk.Anydesk") assert response.status_code == 200 - assert response.json() == _get_expected_json_result("test_summary_by_appid_stable_only") + assert response.json() == _get_expected_json_result( + "test_summary_by_appid_stable_only" + ) def test_summary_by_appid_beta_only(): response = client.get("/summary/com.only.in.beta.Repo") assert response.status_code == 200 - assert response.json() == _get_expected_json_result("test_summary_by_appid_beta_only") + assert response.json() == _get_expected_json_result( + "test_summary_by_appid_beta_only" + ) def test_summary_by_non_existent_id(): diff --git a/tests/ostree/beta-repo/.lock b/tests/ostree/beta-repo/.lock deleted file mode 100644 index e69de29..0000000 diff --git a/tests/ostree/beta-repo/config b/tests/ostree/beta-repo/config deleted file mode 100644 index d289d74..0000000 --- a/tests/ostree/beta-repo/config +++ /dev/null @@ -1,4 +0,0 @@ -[core] -repo_version=1 -mode=archive-z2 -indexed-deltas=true diff --git a/tests/ostree/beta-repo/objects/06/e1f7778c81994966156b640349172066f6d932793bb61b728ca2b5d50ab4e3.dirtree b/tests/ostree/beta-repo/objects/06/e1f7778c81994966156b640349172066f6d932793bb61b728ca2b5d50ab4e3.dirtree deleted file mode 100644 index c5b544d98822001f2d4a172f06ee80499faabbeb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 49 zcmc~z%*#wmEiTc^D$dVi&}rv0E&UhFs&x6FL9gYK!wgp$*8fsDyy{WD=EmC4pk_XO F0|4>n6k-4X diff --git a/tests/ostree/beta-repo/objects/13/cf1de7f531b099bde97022106123028bb23e4e0f5f026a87e5fc08b6a81d32.filez b/tests/ostree/beta-repo/objects/13/cf1de7f531b099bde97022106123028bb23e4e0f5f026a87e5fc08b6a81d32.filez deleted file mode 100644 index 390d748094c303e9e25b44beaf69c230ecd2baf7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 244 zcmZQzV31;f14bV>lc8}5m@S#x=k0gIK)~gDahFDR$E`lu?K@dK<{bFjoS`;(qHsdv z4r|4RBOW>TSHD~J-TCsC#aqtCUjAfLnm>K%Zgc6#+q3mux6b)ldHrfb%Qa*f&bms*v-SCvXW|6KQQA@iPV(cewh?KVv{DHIFV7c`U* z;b=IxQIs!3v8$DFZo)~yn=||M(!M5oG%s!3C$C@hr~K~YWA)7S(G$1nd7RtrVY9)d k>E2V1+fs_E?2X2SY{y#8Ieok2yna^Egcpq)Y-?(m08(shC;$Ke diff --git a/tests/ostree/beta-repo/objects/17/3b903b7c28b40bb3d48e0ec347c36595d09cb3d799ca6d2f4f6cc16b2f9358.dirtree b/tests/ostree/beta-repo/objects/17/3b903b7c28b40bb3d48e0ec347c36595d09cb3d799ca6d2f4f6cc16b2f9358.dirtree deleted file mode 100644 index d743f61ace38ee1c4a589eba48efc5d1907364c3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 191 zcmc~zElEsCEJ_Gv+1#S6Rd6wz`1%F1E?ImZrE3nRf8NIYwDtJA zciT#TEfKo8OgFwss-y(|7O~3f08QI>eX=a_Du&mxBW%3CX zE~S0DZ?YU=_2&(ZFTHww<*HZnUccJ7DpPK@N$n;b=g%c~e${*~_7vXx?#!lTHB+7S z-e11ezv*>xW#*QSJ5I0vT#H$kd39$``IE!#Qap_DNsJ@ zTZf-wBXdcc$wcSUc~?s_B!a(qxUDs}>ne?XVN&w5V$X*U?{}rk)iv&4J7c>Z$1$n- pE0w=VMhVy6yH+qQ=Rn{Ykw$|Bf#SN`FLbrMxDkCKV*b8*1^}B8aftu` diff --git a/tests/ostree/beta-repo/objects/3b/2099c61290dfb4fd31d5a081b64524102bb71d87d0c6fa70731d894b7a0a4b.filez b/tests/ostree/beta-repo/objects/3b/2099c61290dfb4fd31d5a081b64524102bb71d87d0c6fa70731d894b7a0a4b.filez deleted file mode 100644 index 9f999cd7c782abdccdca713ee7b4e4ae5da4a63e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 123 zcmZQzV31-!fD#0=aS50$*9c_3Zhp+WH#TKKpy0_VIhF zrFB;OBul5*($`Bxmo8hjL@a&!6Y&?UPgJHYc`E+&Rd~dVqqAqekd}NQ8Brj*JSBMr LkKakRP!iGd%CmQVtMFvqgc!Q_@b4Mjox!|%RVrDmOATL>GD~Up*_DYbi0>u zamp+(UehVN>hq#J2jv-y+|9D~el(0WZ*e^A5Pvk(@BhB)J744v-w$1q%iXl`m@vQ2 myanbLFMo5>n9O*5q6Jg3!(zRtmkZBZx~Sh{O02H<&j0{xziE;H diff --git a/tests/ostree/beta-repo/objects/44/214b76684c64afc0308c62313ec14b253fd83c6e344811cab851e70d56f8de.commit b/tests/ostree/beta-repo/objects/44/214b76684c64afc0308c62313ec14b253fd83c6e344811cab851e70d56f8de.commit deleted file mode 100644 index 28239f254f05405c8df27a4d049f50305e66ecc5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 596 zcmb3xS%1=z>vV&6gRzEXv4g~$2pSb zSRGcU2`z~^ET$Et;gTJ+gAE(iO|(I#oshL SUUTP!bZ9XBVO+)74~76W9J|v1 diff --git a/tests/ostree/beta-repo/objects/44/6a0ef11b7cc167f3b603e585c7eeeeb675faa412d5ec73f62988eb0b6c5488.dirmeta b/tests/ostree/beta-repo/objects/44/6a0ef11b7cc167f3b603e585c7eeeeb675faa412d5ec73f62988eb0b6c5488.dirmeta deleted file mode 100644 index 6757a41ee10d92270b1646be5433266cd6619e94..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12 McmZQzfC0z100DaeF8}}l diff --git a/tests/ostree/beta-repo/objects/4b/1bbd9195d5d593e6bb103f8561c2cfa7ad59048722bb43de5847165cd332b0.filez b/tests/ostree/beta-repo/objects/4b/1bbd9195d5d593e6bb103f8561c2cfa7ad59048722bb43de5847165cd332b0.filez deleted file mode 100644 index d6ce9f8adc1d9f675b5f43fa825f9e9bce7f6f7c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 125 zcmZQzV31-!fJy|jaS50$*9c^{l?vb!|Ogf1OjFK3dm4 z`>yeNs-<;S`(%sPQqiT$mMsxWpZ-Mr1?v-)X-l4pKYbM*G2`g$nJ=UzUr0t2h%Qe_ NUcuvc(k+yQ0RY&;Ejj=I diff --git a/tests/ostree/beta-repo/objects/52/9106b1800fed122ab0cbc72ad603e9103f85ca69050a355a00ff4ac272f1e4.commit b/tests/ostree/beta-repo/objects/52/9106b1800fed122ab0cbc72ad603e9103f85ca69050a355a00ff4ac272f1e4.commit deleted file mode 100644 index bfeee92d9dbd637ffdb537e8042872904c21b493..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 588 zcmbCo!p5&o{9uRlmZ*EZ)pSA827x4$!J% zcBr{PJ*Wl}rC*gHu~-=50HD3OsU?Xii6x0(foR8qf}G6cM37Tsx$+WoQ*AMw!&Ow8 zSCR>pN(1^YCAB!aB)>o}ASbaTEx#xi=3XNMJp&7_;*@N#A;>C&Q?gMN0X@Y735S&Y z^1Ph>Len6*NVUgf+EK1I>Qh)>~ zms3$<9*7GGST3j1%$yR1^2`#TkQ>l11&P@ThI)oTUvNQ!3rr@kHhws&T~+w3s`Bo^ z#n--QM@;=y(dwM?g8hVyQ?^y%x;8c$mn^=I(lrOuKW}4x+IsxmyKSYvmIz&aQ~XV{ T<283qNQVN`C&q=0?O+H1Hs`r& diff --git a/tests/ostree/beta-repo/objects/57/ff61d7adf7fb37053348253b2f9588e6d2fce756b6e2ae4e228ae07206aff2.filez b/tests/ostree/beta-repo/objects/57/ff61d7adf7fb37053348253b2f9588e6d2fce756b6e2ae4e228ae07206aff2.filez deleted file mode 100644 index 61766f41b69cd725b51c55a5c8385e7242ddf869..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 125 zcmZQzV31-!fKmjraS50$*9c)%V=_tJ?Y+*FO7upZ4*4 zs-<;S`y>n3bMd9Gmx?Z3wrq)5`t&E_FIb*`9dE;;}J diff --git a/tests/ostree/beta-repo/objects/6e/340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d.dirtree b/tests/ostree/beta-repo/objects/6e/340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d.dirtree deleted file mode 100644 index f76dd238ade08917e6712764a16a22005a50573d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1 IcmZPo000310RR91 diff --git a/tests/ostree/beta-repo/objects/97/7b12b09e51e36c19376aa6f533fd6bab41fd275eb548f415f63bb639d783bd.dirtree b/tests/ostree/beta-repo/objects/97/7b12b09e51e36c19376aa6f533fd6bab41fd275eb548f415f63bb639d783bd.dirtree deleted file mode 100644 index 43d8561293173a29f1cafa5051c73f2e8ea9ffdb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 191 zcmc~zElEsCEJ>IgL{*wW1)u zsDvTUgnQ2a%~dnzEOmLdyMjxnVuGywW^;?OR>8$=;_Da4x@7Tvl&(3L{&^eo)7Inf z-fb)WwM6LZo8oVp9k01_LORsh(=u~Xiy7D+elPE7oavb+nw`SzDXx(A?WR$s^)~6E To<&=)a&37`$Q(5`&xzUq8+BXd diff --git a/tests/ostree/beta-repo/objects/9f/5db1c17fcefa600b0c51b714526b5d57bb3fe8f71c39748b9cc291cc8e95aa.commit b/tests/ostree/beta-repo/objects/9f/5db1c17fcefa600b0c51b714526b5d57bb3fe8f71c39748b9cc291cc8e95aa.commit deleted file mode 100644 index 763496ca8aae80bf408a340b3920aad2d1bc6c4a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 604 zcmb97D8YK|xMtaw5oyv0QnHxv93O&fqF4%`3?S z3g;K4>!ktxl#*JUU6Nm*7m$-!l9peT3v;KDfu4Z{S8+-|^j`EM{C5FO_pn&x=b;Dzwyl_gBN5kH6E^p4Xk zoP*i=lOtTR_&!S498CYbjrnQo@ptdGmHt{HboEW~H_eXM+&Li~224y$TN&pAVLc-N D(Z9YF diff --git a/tests/ostree/beta-repo/objects/9f/7128805558dbeafd19bb22ca51623eb494bb826d799888502f50d2353be399.dirtree b/tests/ostree/beta-repo/objects/9f/7128805558dbeafd19bb22ca51623eb494bb826d799888502f50d2353be399.dirtree deleted file mode 100644 index ad7f878449608925507cf4044bad32a0f1858523..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 49 zcmc~z%*#wmEiTc^D$dViu<5KWsQLe(I;JyghGEg&OP3#ijsHGB@KiI)iv;7Pb?$un F1^`3j7n1-0 diff --git a/tests/ostree/beta-repo/objects/a6/5f1a6cce2e4a0a161a55754bbbf5316cf1fb6726e77d64e984fd9cbe951712.commit b/tests/ostree/beta-repo/objects/a6/5f1a6cce2e4a0a161a55754bbbf5316cf1fb6726e77d64e984fd9cbe951712.commit deleted file mode 100644 index e0d49155835517d69cbda9aa8cc9d3a100851d2c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 572 zcmb97D8YK|xMtaw5oyv0QnHxv93O&fqF4%`3?S z3g;K4>!ktxl#*JUU6Nm*7m$-!l9peT3v;KDfu4Z{S8+-|^j`EM|1AD9A4=Q9yMfgCEe@R%n7;jz!5CRtk_n z!X%mZ;Dfyw1mnwe9gP@Y)=6mkRlqaZO`!BEc-=mRdOyFgR|YZH&S^#to0jV;`p zuk`U9c0Zgt^}?LZ*Jqx})%VXin5{oK!X=CEqjb%|^v~OvpSB)<_ikJ1uO&iP-xPn- U?0C(c6Vf5T^oVgPV?7uG0Co|t2LJ#7 diff --git a/tests/ostree/beta-repo/objects/af/e62d9d85075279e3d675fc4e9313fae814aeb2ec6110bfc3ba945d4759d996.filez b/tests/ostree/beta-repo/objects/af/e62d9d85075279e3d675fc4e9313fae814aeb2ec6110bfc3ba945d4759d996.filez deleted file mode 100644 index c251f2c09f5d8e93134a555bf6283be7c8c07c38..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 123 zcmZQzV31-!fGPyDaS50$*9c)%V=_tKMf;`*`Y}yH?zC zA;xuSrRq$FoqraU?A@~HO2~u+&$`Aq2frlGsJg&)b*-(DduDd-o7gz7ku|)~%dG9x KgDE*7t_%PMMlTTn diff --git a/tests/ostree/beta-repo/objects/bd/18589ad0b3b9ecbc1ad369f188536a40caf281a35f54f0f37390c71aef9d90.filez b/tests/ostree/beta-repo/objects/bd/18589ad0b3b9ecbc1ad369f188536a40caf281a35f54f0f37390c71aef9d90.filez deleted file mode 100644 index 4fdeb61b6033047f44f5a011d7960f95eb992d7b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 242 zcmZQzV31;f14eH+lc8}5m@S#x=k0gcK*aTVtm_m*m-BtH_T|C~8<~FBDrC(K@oQjA zdfy_VqGh=E`9C{8-^+b>%#JUc>;1hhau@s6iA(nWR@=F(Gp=mc8qN9jPkvdgO`e#& z%C0=hHDcOjtN2~Vi=#@{Jv~KCj7hI6PyKyHVEOkAZ8X4=qSMas5%N|Nni}x4y(5z8`w#wirut?|Bn}-#mLe h?eg<2yv-hHq;)w+Tv*XPt@?$lQ^_0MlpOx~@c?4SXX*d| diff --git a/tests/ostree/beta-repo/objects/c5/2b7a71e67a79ddc1a3d6f42b5895fa78854364e807c81c426b3a71ae86061c.dirtree b/tests/ostree/beta-repo/objects/c5/2b7a71e67a79ddc1a3d6f42b5895fa78854364e807c81c426b3a71ae86061c.dirtree deleted file mode 100644 index bf77c1d59549930c3af37885f3a80defa0e1d747..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 191 zcmc~zElEsCEJeZ{0pY0Z~Z%sUOe)-x+mUgAx&i5kR#bPcSZQ#^OttiMZ zDq+Yo;hyt_Gv+1#S6Rd6wz`1%F1E?ImZrE3nRf8NIYwDtJA zciT#TEfKoWEB|=x<6o1p~c+H&?(xJ|tmYI`U%<$^dJl#D!b^I${t`)Uydw<~N>Dk@wt)D+@ U9O~D;^=;oo}ASbaTEx#xi=1wC6Jp&7_;*@L*mBA_5sEUA|;Q{(PCBHl`CqEHO zFfuUaGL#4^Gx#u6GwfyXV9aK8ttiMZDp5dj8iOCuwN|KNT#iM_8CD9Au;X$nO3VXs zAz{enRGOJnqEMb$0u*usI=>(>TftDz5a@6&a9AX;Hfevzo-LBXqmk?6Y-z;Fn7MSN zk@x9KspmfLmp3c<WEB|=x<6o1p~c+H&?(!s!V KgRzIP91H=~o~ug$ diff --git a/tests/ostree/beta-repo/refs/heads/app/com.anydesk.Anydesk/x86_64/stable b/tests/ostree/beta-repo/refs/heads/app/com.anydesk.Anydesk/x86_64/stable deleted file mode 100644 index 2d222a3..0000000 --- a/tests/ostree/beta-repo/refs/heads/app/com.anydesk.Anydesk/x86_64/stable +++ /dev/null @@ -1 +0,0 @@ -44214b76684c64afc0308c62313ec14b253fd83c6e344811cab851e70d56f8de diff --git a/tests/ostree/beta-repo/refs/heads/app/com.wps.Office/x86_64/stable b/tests/ostree/beta-repo/refs/heads/app/com.wps.Office/x86_64/stable deleted file mode 100644 index f868faa..0000000 --- a/tests/ostree/beta-repo/refs/heads/app/com.wps.Office/x86_64/stable +++ /dev/null @@ -1 +0,0 @@ -9f5db1c17fcefa600b0c51b714526b5d57bb3fe8f71c39748b9cc291cc8e95aa diff --git a/tests/ostree/beta-repo/refs/heads/app/org.sugarlabs.Maze/x86_64/stable b/tests/ostree/beta-repo/refs/heads/app/org.sugarlabs.Maze/x86_64/stable deleted file mode 100644 index bdfe857..0000000 --- a/tests/ostree/beta-repo/refs/heads/app/org.sugarlabs.Maze/x86_64/stable +++ /dev/null @@ -1 +0,0 @@ -529106b1800fed122ab0cbc72ad603e9103f85ca69050a355a00ff4ac272f1e4 diff --git a/tests/ostree/beta-repo/summaries/2c7d1e349de7d0b20bb73cc76799ad6004833ab59d4111f55048c357b651ae12-386998efb2f56f8ba0981d9ad7184b34f99a23a91595f43df348f82cbc580437.delta b/tests/ostree/beta-repo/summaries/2c7d1e349de7d0b20bb73cc76799ad6004833ab59d4111f55048c357b651ae12-386998efb2f56f8ba0981d9ad7184b34f99a23a91595f43df348f82cbc580437.delta deleted file mode 100644 index 18a63d8a72d0471d348907b01993b994c15f381d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 335 zcmV-V0kHlbiwFP!000021FJ|(Nn>GPVBlb4P~c)@V9;P-5CCF@#DW6-<6s}fk7;uuQUW^L9`V}ON2c|ozBe_C2*aw<8Q7Twm>C#=t}ZUk h%}p$-)GbRbDh9d{>TVEGDl9L?3;;1X7N|%9008fmlqLWG diff --git a/tests/ostree/beta-repo/summaries/2c7d1e349de7d0b20bb73cc76799ad6004833ab59d4111f55048c357b651ae12.gz b/tests/ostree/beta-repo/summaries/2c7d1e349de7d0b20bb73cc76799ad6004833ab59d4111f55048c357b651ae12.gz deleted file mode 100644 index 0399c165a344baf349c9adfb7cdce8cd72ae19ee..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 237 zcmV6A0`Gc2%5;Yv4Q`skk*FN$F;68zZ9@fQV9Ic`il(jBN-0G64VpR_$Hv diff --git a/tests/ostree/beta-repo/summaries/386998efb2f56f8ba0981d9ad7184b34f99a23a91595f43df348f82cbc580437.gz b/tests/ostree/beta-repo/summaries/386998efb2f56f8ba0981d9ad7184b34f99a23a91595f43df348f82cbc580437.gz deleted file mode 100644 index 615352952a232781f5765d01b3732e07412f6d85..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 393 zcmV;40e1c$iwFP!0000014}F@&`-|K)l1B)Oi3-y)^mi=`V|&t@n$Ca#U+VJIjIZ` z3?WPmVBn(YU6$dKvi^WUPm-bCL2p(28#Z|+9)hQK1U}~t`*E)#Q7EXgm>3&=?h@V<=&pwOK=rArTr5 z@pe1p6OkPH|~^Vo^?FQn8+IVilG!@PYb2Xd>Ij2L87~ zS{qIu*Sg01Qoz3TR3wvecqtplhK%01>6a@?y*YMvwXaIs*Uz3J$f~ diff --git a/tests/ostree/beta-repo/summaries/76d192d80f282a6963af9782e9c2b6a5c7156f17a7137ebcf941d67157c4a690-386998efb2f56f8ba0981d9ad7184b34f99a23a91595f43df348f82cbc580437.delta b/tests/ostree/beta-repo/summaries/76d192d80f282a6963af9782e9c2b6a5c7156f17a7137ebcf941d67157c4a690-386998efb2f56f8ba0981d9ad7184b34f99a23a91595f43df348f82cbc580437.delta deleted file mode 100644 index 9c3ce3e5d8862b811e7810fd7aadd466b85aad00..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 329 zcmV-P0k-}hiwFP!000021FJ|(Nn>YVVBlb6P|yI<7Z?}>fLK9*k%2)A$OdAC#DW6- zTM6aY6>Z%0RrZ|QYwpp7s)EHu*{+l1W@nHSAUkThif!jrbvSY({+rRiO zV_DKY=g`D6eN$KA@LwSg|CJXM>-ndpWhST6*lTG1^59@(XA)p$U;w(exHLC6v8YnF bEVZZ@=sKv2K}4yrycjb8m#;@BCISEeoHdpy diff --git a/tests/ostree/beta-repo/summaries/76d192d80f282a6963af9782e9c2b6a5c7156f17a7137ebcf941d67157c4a690.gz b/tests/ostree/beta-repo/summaries/76d192d80f282a6963af9782e9c2b6a5c7156f17a7137ebcf941d67157c4a690.gz deleted file mode 100644 index 0254b4cdedddd5e69087e9caff5729ba1f243d81..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 319 zcmV-F0l@wriwFP!0000014}F@&`-|K)hjP3*7HwG%S=wyudpzSH#5;ME=f$vNo9Zn z8zu<7EM6+-oSqk#m{e$~_wKKTIUj$gt39txdD-%J&c3PQLKTU6DTyVCP+crgnz1n2 zv7jI)GdZy&Ge0kuD=#rO)fUxSuA#2Tf$#*uei*NNdCC<6764Ukcc_p2}q9GL2&R?{%o? z;}abIFUI13OlxTz1`HVC(D(ru4l_4vs51O#-~js&=>Fo;+}y;XO5L*5qGF(Hp*{c+ RrNZ(&OaNUD3K}v3005WMioXB= diff --git a/tests/ostree/beta-repo/summaries/94bee1ee1bbd230aba77f907dd105f97ffcfbd8347e0c80066eca80897422d3f-386998efb2f56f8ba0981d9ad7184b34f99a23a91595f43df348f82cbc580437.delta b/tests/ostree/beta-repo/summaries/94bee1ee1bbd230aba77f907dd105f97ffcfbd8347e0c80066eca80897422d3f-386998efb2f56f8ba0981d9ad7184b34f99a23a91595f43df348f82cbc580437.delta deleted file mode 100644 index 24ddebfd1cc6222dcd6a4aff2650800c9e605cea..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 261 zcmV+g0s8(QiwFP!000021FJ|(Nn>GPVBlb6P~c!T zM6aY6>Z%0RrZ|QYwpp7s)PUi_&LqIhzyNfAacORDVo{}TS!z)+(6vw>fQV9Ic`;@H LGN}hkN&x@>FhOy$ diff --git a/tests/ostree/beta-repo/summaries/94bee1ee1bbd230aba77f907dd105f97ffcfbd8347e0c80066eca80897422d3f.gz b/tests/ostree/beta-repo/summaries/94bee1ee1bbd230aba77f907dd105f97ffcfbd8347e0c80066eca80897422d3f.gz deleted file mode 100644 index 7a58584084bb8a1aa4046d14e599f1493eaa0cdd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 320 zcmV-G0l)qqiwFP!0000014}F@&`-|K)hjP3*7HwG%S=wyudpzSH#5;ME=f$vNo9b7 z7$yikKX&86`g6Y$xOoD%iv(rIhVQn2@m4m1F{i^NZ5;(uz`3Q&NkwOY#f!0&)^d((;RP zVeT?A&@-^$Do)A9P#K((jjD)&L8GLkSd#bkLRuS6AJ@9Z{8GTa^;9M+muVEkf3HJD zAD`gxe=!#SV_Hk&Fkrw4hsF=UaG1GSLzUq_0|(fLK=&7y=H@0ARqB?d78L_s3-tkr SC>56HVFCc=FK3-H0ssJu$CaG` diff --git a/tests/ostree/beta-repo/summaries/da0308f06b33f241439b4717fcb6795bc17f80e2efbc0a7218dd087b40dbe348-386998efb2f56f8ba0981d9ad7184b34f99a23a91595f43df348f82cbc580437.delta b/tests/ostree/beta-repo/summaries/da0308f06b33f241439b4717fcb6795bc17f80e2efbc0a7218dd087b40dbe348-386998efb2f56f8ba0981d9ad7184b34f99a23a91595f43df348f82cbc580437.delta deleted file mode 100644 index b83aafa98dc69b22e6636d3580ceb323984ab335..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 336 zcmV-W0k8faiwFP!000021FJ|(N#kN*VBlb6P|yI<7Z?}>fLMVY$o>Ijb22h8XaZ>< zRsb>?5(^6Slk;=+67wokQj4?o93ixRg@swXnTdXJNn%n?Do|Yr69X8yD0-J=_@t~q zV9=9fXm`+C)&7P}o{5LxsU3mOdBc9(t4P#KNi0c(C}v=R(u~E?js*odnaPPInfZCK zTzQGPskT_GIh=D<)q@-Ar1LBhW61|dQsH+lKo8lNs*k*0kP-BRJ`fq;h#)I|eekE}81a21z z%8m`+ZU5rCjAcppoI?}O^i5rb!+(W1{8wI3tmmJWmYJMNW3Qq4%Y%cFok@V1fdS~= i;?msQ#G*>wvecqtpzEM61`(yg@?roh8NOaI0ssK#{GfpV diff --git a/tests/ostree/beta-repo/summaries/da0308f06b33f241439b4717fcb6795bc17f80e2efbc0a7218dd087b40dbe348.gz b/tests/ostree/beta-repo/summaries/da0308f06b33f241439b4717fcb6795bc17f80e2efbc0a7218dd087b40dbe348.gz deleted file mode 100644 index 9fe133399bfb9d14178d8fd2e1ea2a7d72dce136..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 381 zcmV-@0fPP?iwFP!0000014}F@&`-|K)hjP3*7HwG%S=wyudpzSH#5;ME=f$vNo9Zn z8zu<7EM6+-oSqk#m{e$~_wKKTIUj$gt39txdD-%J&c3PQLKTU6DTyVCP+crgnz1n2 zv7jI)GdZy&Ge0kuD=#rO)fUxSuA=)O;2y5`&%36 z?-KVm{hFin^=Vw bvecqtplhK%01>6a@@&iiDysZ1DgyujLqWC; diff --git a/tests/ostree/beta-repo/summary b/tests/ostree/beta-repo/summary deleted file mode 100644 index a5218747cb610bb9ebbfb7db1b2c979d7501a508..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1195 zcmYc+D9}&N&(%xJt4v8P&en5;(E1e?X7Oew`o$%QNja$u3=APmKmrI{6urwbd{WjQ zFz87#v^(gnYJbBf&%{IU)Q-UCykS4?M8>EdVuX!gxH&3l&)7?nx0sclbBSj=bKoC#cm&{y+IS%Ha76T71G*p z`nc9L=9dEYt*0_sxlE%N{(BuN`uGIDy^SBh_NtaKykkgX1bGOmzPL0uH?gQvFE>90 z6uLln6(wh6mZj=e88I*vi(sfL$$(=TTm3H z0TUW1&6eaB=mq2?mZaqu<-!t?k%69p1y^xOHipXJlx$Q*48YV#e0oH4cOedUBa$^u zoU91WKg6VCH1}c)XG~*g;%3z?4C##0Obm(D#Tq3g#hSGYWt+-e&g)Cm7P+tl*gLq-%eRnd3vY@h3;;+3wd5%9+f4eqj^$ zcAMkrGuI}tG+S+*>nQj&z~gZEw!n2l3JwVk3_!3%fqgTG&Mz)0N=?-(F3rtNEUMJY z%}+@M2{R-XC1+%orRr80F)$R1V5lp}&rK>W$t^QOicmFgFpgnQyfEyESO!9sF$3WoRO+q amReMtnV$z11QJXjMya4$NX_c=TNnUs_>i9f diff --git a/tests/results/test_appstream_by_appid.json b/tests/results/test_appstream_by_appid.json index ee69d13..244bec8 100644 --- a/tests/results/test_appstream_by_appid.json +++ b/tests/results/test_appstream_by_appid.json @@ -1,5 +1,5 @@ { - "stable": { + "beta": { "description": "

Good at finding your way out of hard situations? Let's see! Try to make your way through an increasingly difficult path.

", "screenshots": [ { @@ -57,7 +57,7 @@ "sdk": "org.gnome.Sdk/x86_64/3.36" } }, - "beta": { + "stable": { "description": "

Good at finding your way out of hard situations? Let's see! Try to make your way through an increasingly difficult path.

", "screenshots": [ { @@ -99,7 +99,7 @@ "type": "gettext" }, "name": "Maze", - "summary": "A simple maze game, but this is the beta version", + "summary": "A simple maze game", "developer_name": "Sugar Labs Community", "categories": ["Game"], "kudos": ["HiDpiIcon"], diff --git a/tests/results/test_appstream_by_appid_beta_only.json b/tests/results/test_appstream_by_appid_beta_only.json index 54db110..9a1d144 100644 --- a/tests/results/test_appstream_by_appid_beta_only.json +++ b/tests/results/test_appstream_by_appid_beta_only.json @@ -1,6 +1,6 @@ { "beta": { - "description": "Developers, Developers, Developers, Developers", + "description": "

Developers, Developers, Developers, Developers

", "screenshots": [ { "624x351": "https://dl.flathub.org/repo/screenshots/com.only.in.beta.Repo-stable/624x351/com.only.in.beta.Repo-4308958995b5f213eac85c7053e01a33.png", @@ -39,8 +39,12 @@ "name": "Beta app", "summary": "A simple beta test app", "developer_name": "Developer", - "categories": ["Game"], - "kudos": ["HiDpiIcon"], + "categories": [ + "Game" + ], + "kudos": [ + "HiDpiIcon" + ], "project_license": "GPL-3.0-or-later", "launchable": { "value": "com.only.in.beta.Repo.desktop", @@ -53,4 +57,4 @@ "sdk": "org.gnome.Sdk/x86_64/3.36" } } -} +} \ No newline at end of file diff --git a/tests/results/test_appstream_by_appid_stable_only.json b/tests/results/test_appstream_by_appid_stable_only.json index ff95a6a..9e10bc8 100644 --- a/tests/results/test_appstream_by_appid_stable_only.json +++ b/tests/results/test_appstream_by_appid_stable_only.json @@ -80,23 +80,50 @@ } ], "content_rating": { - "type": "oars-1.1" + "drugs-alcohol": "none", + "drugs-narcotics": "none", + "drugs-tobacco": "none", + "language-discrimination": "none", + "language-humor": "none", + "language-profanity": "none", + "money-gambling": "none", + "money-purchasing": "none", + "sex-adultery": "none", + "sex-appearance": "none", + "sex-homosexuality": "none", + "sex-nudity": "none", + "sex-prostitution": "none", + "sex-themes": "none", + "social-audio": "none", + "social-chat": "intense", + "social-contacts": "none", + "social-info": "none", + "social-location": "none", + "type": "oars-1.1", + "violence-bloodshed": "none", + "violence-cartoon": "none", + "violence-desecration": "none", + "violence-fantasy": "none", + "violence-realistic": "none", + "violence-sexual": "none", + "violence-slavery": "none", + "violence-worship": "none" }, "urls": { "bugtracker": "https://github.com/flathub/com.anydesk.Anydesk/issues", "homepage": "https://www.anydesk.com" }, - "icon": "https://lh3.googleusercontent.com/bpm79oQCS4VMwIG-jajHfpsIhsUodP5fHDa3V2cMXLiwkSscAAviezm9YlmSxgjkB-A=w128", + "icon": "https://dl.flathub.org/repo/appstream/x86_64/icons/128x128/com.anydesk.Anydesk.png", "id": "com.anydesk.Anydesk", - "translation": { - "value": "com.anydesk.Anydesk", - "type": "gettext" - }, "name": "AnyDesk", "summary": "Connect to a computer remotely", "developer_name": "AnyDesk Software GmbH", - "categories": ["Network"], - "kudos": ["HiDpiIcon"], + "categories": [ + "Network" + ], + "kudos": [ + "HiDpiIcon" + ], "project_license": "LicenseRef-proprietary", "launchable": { "value": "com.anydesk.Anydesk.desktop", @@ -107,6 +134,9 @@ "type": "flatpak", "runtime": "org.freedesktop.Platform/x86_64/20.08", "sdk": "org.freedesktop.Sdk/x86_64/20.08" + }, + "metadata": { + "X-Flatpak-Tags": "proprietary" } } -} +} \ No newline at end of file diff --git a/tests/results/test_feed_by_new.xml b/tests/results/test_feed_by_new.xml index 68aa7ba..1bb7ebc 100644 --- a/tests/results/test_feed_by_new.xml +++ b/tests/results/test_feed_by_new.xml @@ -1,2 +1,2 @@ -Flathub – recently added applicationshttps://flathub.org/apps/collection/newApplications recently published on Flathubhttp://www.rssboard.org/rss-specificationpython-feedgenenWed, 27 Jan 2021 16:25:03 +0000AnyDeskhttps://flathub.org/apps/details/com.anydesk.Anydesk<img src="https://dl.flathub.org/repo/appstream/x86_64/icons/128x128/com.anydesk.Anydesk.png"><p>Connect to a computer remotely</p><p><p>AnyDesk ensures secure and reliable remote desktop connections for IT professionals and on-the-go individuals alike.</p><p>NOTE: This wrapper is not verified by, affiliated with, or supported by AnyDesk.</p></p><h3>Additional information:</h3><ul><li>Developer: AnyDesk Software GmbH</li><li>Version: 6.0.1</ul><img src="https://dl.flathub.org/repo/screenshots/com.anydesk.Anydesk-stable/624x351/com.anydesk.Anydesk-b8f4a58c33a1e1603bad8a835f244173.png">Mon, 18 Jan 2021 12:43:10 +0000WPS Officehttps://flathub.org/apps/details/com.wps.Office<img src="https://dl.flathub.org/repo/appstream/x86_64/icons/128x128/com.wps.Office.png"><p>WPS Office Suite</p><p><p>WPS Office including Writer, Presentation and Spreadsheets, is a powerful office suite, which is able to process word file, produce wonderful slides, and analyze data as well. It is deeply compatible with all of the latest Microsoft Office file formats. It can easily open and read the documents created with Microsoft Office.</p><p>NOTE: This wrapper is not verified by, affiliated with, or supported by Kingsoft Office Corporation</p></p><h3>Additional information:</h3><ul><li>Developer: Kingsoft Office Corporation</li><li>Version: 11.1.0.9719</ul><img src="https://dl.flathub.org/repo/screenshots/com.wps.Office-stable/624x351/com.wps.Office-3f78a399034d6606d866e875e6938d51.png"><img src="https://dl.flathub.org/repo/screenshots/com.wps.Office-stable/624x351/com.wps.Office-32f9654272b966cb0be4a4cd14e8d072.png"><img src="https://dl.flathub.org/repo/screenshots/com.wps.Office-stable/624x351/com.wps.Office-f25c528d533cf5a62d3093a0d4656007.png">Mon, 18 Jan 2021 12:42:48 +0000Mazehttps://flathub.org/apps/details/org.sugarlabs.Maze<img src="https://dl.flathub.org/repo/appstream/x86_64/icons/128x128/org.sugarlabs.Maze.png"><p>A simple maze game</p><p><p>Good at finding your way out of hard situations? Let's see! Try to make your way through an increasingly difficult path.</p></p><h3>Additional information:</h3><ul><li>Developer: Sugar Labs Community</li><li>Version: 30</ul><img src="https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/624x351/org.sugarlabs.Maze-4308958995b5f213eac85c7053e01a33.png"><img src="https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/624x351/org.sugarlabs.Maze-0cf71487936dec29c5b092662909f125.png"><img src="https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/624x351/org.sugarlabs.Maze-5d288daae5069cde2ffe86ab4a9285a7.png">Mon, 18 Jan 2021 12:41:20 +0000 +Flathub – recently added applicationshttps://flathub.org/apps/collection/newApplications recently published on Flathubhttp://www.rssboard.org/rss-specificationpython-feedgenenWed, 27 Jan 2021 16:25:03 +0000AnyDeskhttps://flathub.org/apps/details/com.anydesk.Anydesk<img src="https://dl.flathub.org/repo/appstream/x86_64/icons/128x128/com.anydesk.Anydesk.png"><p>Connect to a computer remotely</p><p><p>AnyDesk ensures secure and reliable remote desktop connections for IT professionals and on-the-go individuals alike.</p><p>NOTE: This wrapper is not verified by, affiliated with, or supported by AnyDesk.</p></p><h3>Additional information:</h3><ul><li>Developer: AnyDesk Software GmbH</li><li>Version: 6.0.1</ul><img src="https://dl.flathub.org/repo/screenshots/com.anydesk.Anydesk-stable/624x351/com.anydesk.Anydesk-b8f4a58c33a1e1603bad8a835f244173.png">Mon, 18 Jan 2021 12:43:10 +0000WPS Officehttps://flathub.org/apps/details/com.wps.Office<img src="https://www.wps.com/assets/mediahub/WPS-Office-Mobile.png"><p>WPS Office Suite</p><p><p>WPS Office including Writer, Presentation and Spreadsheets, is a powerful office suite, which is able to process word file, produce wonderful slides, and analyze data as well. It is deeply compatible with all of the latest Microsoft Office file formats. It can easily open and read the documents created with Microsoft Office.</p><p>NOTE: This wrapper is not verified by, affiliated with, or supported by Kingsoft Office Corporation</p></p><h3>Additional information:</h3><ul><li>Developer: Kingsoft Office Corporation</li><li>Version: 11.1.0.9719</ul><img src="https://dl.flathub.org/repo/screenshots/com.wps.Office-stable/624x351/com.wps.Office-3f78a399034d6606d866e875e6938d51.png"><img src="https://dl.flathub.org/repo/screenshots/com.wps.Office-stable/624x351/com.wps.Office-32f9654272b966cb0be4a4cd14e8d072.png"><img src="https://dl.flathub.org/repo/screenshots/com.wps.Office-stable/624x351/com.wps.Office-f25c528d533cf5a62d3093a0d4656007.png">Mon, 18 Jan 2021 12:42:48 +0000Mazehttps://flathub.org/apps/details/org.sugarlabs.Maze<img src="https://dl.flathub.org/repo/appstream/x86_64/icons/128x128/org.sugarlabs.Maze.png"><p>A simple maze game</p><p><p>Good at finding your way out of hard situations? Let's see! Try to make your way through an increasingly difficult path.</p></p><h3>Additional information:</h3><ul><li>Developer: Sugar Labs Community</li><li>Version: 30</ul><img src="https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/624x351/org.sugarlabs.Maze-4308958995b5f213eac85c7053e01a33.png"><img src="https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/624x351/org.sugarlabs.Maze-0cf71487936dec29c5b092662909f125.png"><img src="https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/624x351/org.sugarlabs.Maze-5d288daae5069cde2ffe86ab4a9285a7.png">Mon, 18 Jan 2021 12:41:20 +0000 diff --git a/tests/results/test_feed_by_recently_updated.xml b/tests/results/test_feed_by_recently_updated.xml index e65752f..cc61d9c 100644 --- a/tests/results/test_feed_by_recently_updated.xml +++ b/tests/results/test_feed_by_recently_updated.xml @@ -1,2 +1,2 @@ -Flathub – recently updated applicationshttps://flathub.org/apps/collection/recently-updatedRecently updated applications published on Flathubhttp://www.rssboard.org/rss-specificationpython-feedgenenMon, 18 Jan 2021 13:42:57 +0000AnyDeskhttps://flathub.org/apps/details/com.anydesk.Anydesk<img src="https://dl.flathub.org/repo/appstream/x86_64/icons/128x128/com.anydesk.Anydesk.png"><p>Connect to a computer remotely</p><p><p>AnyDesk ensures secure and reliable remote desktop connections for IT professionals and on-the-go individuals alike.</p><p>NOTE: This wrapper is not verified by, affiliated with, or supported by AnyDesk.</p></p><h3>Additional information:</h3><ul><li>Developer: AnyDesk Software GmbH</li><li>Version: 6.0.1</ul><img src="https://dl.flathub.org/repo/screenshots/com.anydesk.Anydesk-stable/624x351/com.anydesk.Anydesk-b8f4a58c33a1e1603bad8a835f244173.png">Mon, 18 Jan 2021 12:43:10 +0000WPS Officehttps://flathub.org/apps/details/com.wps.Office<img src="https://dl.flathub.org/repo/appstream/x86_64/icons/128x128/com.wps.Office.png"><p>WPS Office Suite</p><p><p>WPS Office including Writer, Presentation and Spreadsheets, is a powerful office suite, which is able to process word file, produce wonderful slides, and analyze data as well. It is deeply compatible with all of the latest Microsoft Office file formats. It can easily open and read the documents created with Microsoft Office.</p><p>NOTE: This wrapper is not verified by, affiliated with, or supported by Kingsoft Office Corporation</p></p><h3>Additional information:</h3><ul><li>Developer: Kingsoft Office Corporation</li><li>Version: 11.1.0.9719</ul><img src="https://dl.flathub.org/repo/screenshots/com.wps.Office-stable/624x351/com.wps.Office-3f78a399034d6606d866e875e6938d51.png"><img src="https://dl.flathub.org/repo/screenshots/com.wps.Office-stable/624x351/com.wps.Office-32f9654272b966cb0be4a4cd14e8d072.png"><img src="https://dl.flathub.org/repo/screenshots/com.wps.Office-stable/624x351/com.wps.Office-f25c528d533cf5a62d3093a0d4656007.png">Mon, 18 Jan 2021 12:42:48 +0000Mazehttps://flathub.org/apps/details/org.sugarlabs.Maze<img src="https://dl.flathub.org/repo/appstream/x86_64/icons/128x128/org.sugarlabs.Maze.png"><p>A simple maze game</p><p><p>Good at finding your way out of hard situations? Let's see! Try to make your way through an increasingly difficult path.</p></p><h3>Additional information:</h3><ul><li>Developer: Sugar Labs Community</li><li>Version: 30</ul><img src="https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/624x351/org.sugarlabs.Maze-4308958995b5f213eac85c7053e01a33.png"><img src="https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/624x351/org.sugarlabs.Maze-0cf71487936dec29c5b092662909f125.png"><img src="https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/624x351/org.sugarlabs.Maze-5d288daae5069cde2ffe86ab4a9285a7.png">Mon, 18 Jan 2021 12:41:20 +0000 +Flathub – recently updated applicationshttps://flathub.org/apps/collection/recently-updatedRecently updated applications published on Flathubhttp://www.rssboard.org/rss-specificationpython-feedgenenMon, 18 Jan 2021 13:42:57 +0000AnyDeskhttps://flathub.org/apps/details/com.anydesk.Anydesk<img src="https://dl.flathub.org/repo/appstream/x86_64/icons/128x128/com.anydesk.Anydesk.png"><p>Connect to a computer remotely</p><p><p>AnyDesk ensures secure and reliable remote desktop connections for IT professionals and on-the-go individuals alike.</p><p>NOTE: This wrapper is not verified by, affiliated with, or supported by AnyDesk.</p></p><h3>Additional information:</h3><ul><li>Developer: AnyDesk Software GmbH</li><li>Version: 6.0.1</ul><img src="https://dl.flathub.org/repo/screenshots/com.anydesk.Anydesk-stable/624x351/com.anydesk.Anydesk-b8f4a58c33a1e1603bad8a835f244173.png">Mon, 18 Jan 2021 12:43:10 +0000WPS Officehttps://flathub.org/apps/details/com.wps.Office<img src="https://www.wps.com/assets/mediahub/WPS-Office-Mobile.png"><p>WPS Office Suite</p><p><p>WPS Office including Writer, Presentation and Spreadsheets, is a powerful office suite, which is able to process word file, produce wonderful slides, and analyze data as well. It is deeply compatible with all of the latest Microsoft Office file formats. It can easily open and read the documents created with Microsoft Office.</p><p>NOTE: This wrapper is not verified by, affiliated with, or supported by Kingsoft Office Corporation</p></p><h3>Additional information:</h3><ul><li>Developer: Kingsoft Office Corporation</li><li>Version: 11.1.0.9719</ul><img src="https://dl.flathub.org/repo/screenshots/com.wps.Office-stable/624x351/com.wps.Office-3f78a399034d6606d866e875e6938d51.png"><img src="https://dl.flathub.org/repo/screenshots/com.wps.Office-stable/624x351/com.wps.Office-32f9654272b966cb0be4a4cd14e8d072.png"><img src="https://dl.flathub.org/repo/screenshots/com.wps.Office-stable/624x351/com.wps.Office-f25c528d533cf5a62d3093a0d4656007.png">Mon, 18 Jan 2021 12:42:48 +0000Mazehttps://flathub.org/apps/details/org.sugarlabs.Maze<img src="https://dl.flathub.org/repo/appstream/x86_64/icons/128x128/org.sugarlabs.Maze.png"><p>A simple maze game</p><p><p>Good at finding your way out of hard situations? Let's see! Try to make your way through an increasingly difficult path.</p></p><h3>Additional information:</h3><ul><li>Developer: Sugar Labs Community</li><li>Version: 30</ul><img src="https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/624x351/org.sugarlabs.Maze-4308958995b5f213eac85c7053e01a33.png"><img src="https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/624x351/org.sugarlabs.Maze-0cf71487936dec29c5b092662909f125.png"><img src="https://dl.flathub.org/repo/screenshots/org.sugarlabs.Maze-stable/624x351/org.sugarlabs.Maze-5d288daae5069cde2ffe86ab4a9285a7.png">Mon, 18 Jan 2021 12:41:20 +0000 \ No newline at end of file diff --git a/tests/results/test_list_appstream_stable_and_beta.json b/tests/results/test_list_appstream_stable_and_beta.json index d46dae1..f7b7026 100644 --- a/tests/results/test_list_appstream_stable_and_beta.json +++ b/tests/results/test_list_appstream_stable_and_beta.json @@ -1,6 +1,6 @@ [ "com.anydesk.Anydesk", + "com.only.in.beta.Repo", "com.wps.Office", - "org.sugarlabs.Maze", - "com.only.in.beta.Repo" + "org.sugarlabs.Maze" ] diff --git a/tests/results/test_summary_by_appid.json b/tests/results/test_summary_by_appid.json index 1cae29d..af0796a 100644 --- a/tests/results/test_summary_by_appid.json +++ b/tests/results/test_summary_by_appid.json @@ -1,5 +1,5 @@ { - "stable": { + "beta": { "arches": ["x86_64"], "timestamp": 1610973680, "download_size": 1024, @@ -11,7 +11,7 @@ "permissions": {} } }, - "beta": { + "stable": { "arches": ["x86_64"], "timestamp": 1610973680, "download_size": 1024, diff --git a/tests/results/test_summary_by_appid_stable_only.json b/tests/results/test_summary_by_appid_stable_only.json index e0e5764..4d5a966 100644 --- a/tests/results/test_summary_by_appid_stable_only.json +++ b/tests/results/test_summary_by_appid_stable_only.json @@ -1,14 +1,16 @@ { "stable": { - "arches": ["x86_64"], - "timestamp": 1610973680, + "arches": [ + "x86_64" + ], + "timestamp": 1610973790, "download_size": 1024, "installed_size": 371, "metadata": { - "name": "org.sugarlabs.Maze", + "name": "com.anydesk.Anydesk", "runtime": "org.freedesktop.Platform/x86_64/20.08", "sdk": "org.freedesktop.Sdk/x86_64/20.08", "permissions": {} } } -} +} \ No newline at end of file From 047955a3ac587989bbb7c082587ccf3c534a5f29 Mon Sep 17 00:00:00 2001 From: Kolja Lampe Date: Sat, 4 Dec 2021 13:43:48 +0100 Subject: [PATCH 3/3] Add endpoint to list apps by dev --- app/apps.py | 18 ++++++++++- app/db.py | 4 +++ app/main.py | 39 +++++++++++++++++++++-- tests/main.py | 11 +++++++ tests/results/test_apps_by_developer.json | 3 ++ 5 files changed, 71 insertions(+), 4 deletions(-) create mode 100644 tests/results/test_apps_by_developer.json diff --git a/app/apps.py b/app/apps.py index f0d032f..867cb16 100644 --- a/app/apps.py +++ b/app/apps.py @@ -14,10 +14,12 @@ def load_appstream(): current_apps = db.get_apps("stable") current_apps_beta = db.get_apps("beta") current_categories = db.redis_conn.smembers("categories:index") + current_developers = db.redis_conn.smembers("developers:index") db.initialize() with db.redis_conn.pipeline() as p: p.delete("categories:index", *current_categories) + p.delete("developers:index", *current_developers) for appid in apps: redis_key = f"apps:{appid}" @@ -46,6 +48,10 @@ def load_appstream(): p.sadd("categories:index", category) p.sadd(f"categories:{category}", redis_key) + if developer_name := apps[appid]["stable"].get("developer_name"): + p.sadd("developers:index", developer_name) + p.sadd(f"developers:{developer_name}", redis_key) + p.set(f"apps:{appid}", json.dumps(apps[appid])) for appid in current_apps - set(apps_stable): @@ -108,7 +114,17 @@ def get_category(category: str, repo: str = "stable"): return [(app[repo]["id"]) for app in appdata if repo in app] else: - return [] + return None + + +def get_developer(developer: str, repo: str = "stable"): + if index := db.redis_conn.smembers(f"developers:{developer}"): + json_appdata = db.redis_conn.mget(index) + appdata = [json.loads(app) for app in json_appdata] + + return [(app[repo]["id"]) for app in appdata if repo in app] + else: + return None def search(query: str, repo: str = "stable"): diff --git a/app/db.py b/app/db.py index fef8504..4948bce 100644 --- a/app/db.py +++ b/app/db.py @@ -146,3 +146,7 @@ def get_apps(repo: str = "stable"): elif repo == "beta": apps = {app[5:] for app in redis_conn.smembers("apps:index_beta")} return apps + + +def get_developers(): + return {developer for developer in redis_conn.smembers("developers:index")} diff --git a/app/main.py b/app/main.py index bc334b4..df2b82d 100644 --- a/app/main.py +++ b/app/main.py @@ -47,7 +47,9 @@ def update(): @app.get("/category/{category}") -def get_category(category: schemas.Category): +def get_category( + category: schemas.Category, +): ids = apps.get_category(category) downloads = stats.get_downloads_by_ids(ids) @@ -62,6 +64,34 @@ def get_category(category: schemas.Category): return sorted_ids +@app.get("/developer/") +def get_developers(): + return db.get_developers() + + +@app.get("/developer/{developer}") +def get_developer( + developer: str, + response: Response, +): + ids = apps.get_developer(developer) + + if not ids: + response.status_code = 404 + return response + + downloads = stats.get_downloads_by_ids(ids) + sorted_ids = sorted( + ids, + key=lambda appid: downloads.get(appid, {"downloads_last_month": 0}).get( + "downloads_last_month", 0 + ), + reverse=True, + ) + + return sorted_ids + + @app.get("/appstream") def list_appstream(type: schemas.AppstreamType = "stable"): return apps.list_appstream(type) @@ -112,13 +142,16 @@ def get_popular_days(days: int): @app.get("/feed/recently-updated") def get_recently_updated_apps_feed(type: schemas.AppstreamType = "stable"): return Response( - content=feeds.get_recently_updated_apps_feed(type), media_type="application/rss+xml" + content=feeds.get_recently_updated_apps_feed(type), + media_type="application/rss+xml", ) @app.get("/feed/new") def get_new_apps_feed(type: schemas.AppstreamType = "stable"): - return Response(content=feeds.get_new_apps_feed(type), media_type="application/rss+xml") + return Response( + content=feeds.get_new_apps_feed(type), media_type="application/rss+xml" + ) @app.get("/status", status_code=200) diff --git a/tests/main.py b/tests/main.py index 62452f1..bc48320 100644 --- a/tests/main.py +++ b/tests/main.py @@ -92,6 +92,17 @@ def test_apps_by_non_existent_category(): assert response.status_code == 422 +def test_apps_by_developer(): + response = client.get("/developer/Sugar Labs Community") + assert response.status_code == 200 + assert response.json() == _get_expected_json_result("test_apps_by_developer") + + +def test_apps_by_non_existent_developer(): + response = client.get("/developer/NonExistent") + assert response.status_code == 404 + + def test_appstream_by_appid(): response = client.get("/appstream/org.sugarlabs.Maze") assert response.status_code == 200 diff --git a/tests/results/test_apps_by_developer.json b/tests/results/test_apps_by_developer.json new file mode 100644 index 0000000..f57fe20 --- /dev/null +++ b/tests/results/test_apps_by_developer.json @@ -0,0 +1,3 @@ +[ + "org.sugarlabs.Maze" +]