From 1a3a05c8b6dbecd65382bc931e07f34c78f9e998 Mon Sep 17 00:00:00 2001 From: atsunatsu Date: Sun, 4 Oct 2026 02:32:39 +0800 Subject: [PATCH] =?UTF-8?q?feat(sources):=20=E9=BB=98=E8=AE=A4=20TLE=20?= =?UTF-8?q?=E6=BA=90=E5=AF=B9=E9=BD=90=E4=B8=8A=E6=B8=B8=EF=BC=889=20?= =?UTF-8?q?=E9=A1=B9=EF=BC=89=EF=BC=8C=E4=BF=9D=E7=95=99=20fork=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新默认顺序(上游"most specific → most generic",fork 新增源保持原位): LAPAN-A2 → ARISS → R4UAB → AutoTLE(GitHub) → AutoTLE(Mirror) → Classified → Amsat → All (CelesTrak active) → SatNOGS;Other 占位保留。 删掉 22 个 CelesTrak 分类组与 McCants inttles.zip(上游 4.4.4 起即如此, 单一 active 组已覆盖),同步请求数 32 → 9。 转发器源顺序维持 SatNOGS → R4UAB(与上游相反)并注明实测理由:两源同源 (共享 2760 uuid),去重先到先得,SatNOGS 副本更新鲜且独有最新星的发射机。 --- .../look4sat/core/domain/source/Sources.kt | 51 +++++++++---------- 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/core/domain/src/main/java/com/rtbishop/look4sat/core/domain/source/Sources.kt b/core/domain/src/main/java/com/rtbishop/look4sat/core/domain/source/Sources.kt index b256bd2c..9e1d9665 100644 --- a/core/domain/src/main/java/com/rtbishop/look4sat/core/domain/source/Sources.kt +++ b/core/domain/src/main/java/com/rtbishop/look4sat/core/domain/source/Sources.kt @@ -18,41 +18,32 @@ package com.rtbishop.look4sat.core.domain.source object Sources { + // Default TLE sources, aligned with upstream's "most specific to most generic" order: + // the first source that knows a satellite gets to name it, with the full catalogue + // (CelesTrak active) as the fallback. Upstream dropped the old CelesTrak category + // groups (amateur/cubesat/weather/...) — a single `active` group covers them and keeps + // the request count (and CelesTrak's 2-hourly "already downloaded" 403s) down. + // The three BA7OPF additions keep their own spots: Kaggle LAPAN-A2 first and the two + // AutoTLE mirrors next to R4UAB (Chinese amateur catalogues, freshest for CN sats). val satelliteDataUrls = mapOf( "LAPAN-A2" to "https://www.kaggle.com/api/v1/datasets/download/muazamnugroho/lapan-a2-satellite-two-line-element-tle-dataset/LAPAN-A2_TLE_latest.txt", + "ARISS" to "https://live.ariss.org/iss.txt", "R4UAB" to "https://r4uab.ru/satonline.txt", "BI4PYM AutoTLE (GitHub)" to "https://raw.githubusercontent.com/BI4PYM/AutoTLE/refs/heads/master/AutoTLE.txt", "BI4PYM AutoTLE (Mirror)" to "https://autotle.bi4pym.cn/AutoTLE.txt", + "Classified" to "https://www.mmccants.org/tles/classfd.zip", + "Amsat" to "https://amsat.org/tle/current/nasabare.txt", "All" to "https://celestrak.org/NORAD/elements/gp.php?GROUP=active&FORMAT=csv", "SatNOGS" to "https://db.satnogs.org/api/tle/?format=3le", - "Amateur" to "https://celestrak.org/NORAD/elements/gp.php?GROUP=amateur&FORMAT=csv", - "Brightest" to "https://celestrak.org/NORAD/elements/gp.php?GROUP=visual&FORMAT=csv", - "Cubesat" to "https://celestrak.org/NORAD/elements/gp.php?GROUP=cubesat&FORMAT=csv", - "Education" to "https://celestrak.org/NORAD/elements/gp.php?GROUP=education&FORMAT=csv", - "Engineer" to "https://celestrak.org/NORAD/elements/gp.php?GROUP=engineering&FORMAT=csv", - "Geostationary" to "https://celestrak.org/NORAD/elements/gp.php?GROUP=geo&FORMAT=csv", - "Globalstar" to "https://celestrak.org/NORAD/elements/gp.php?GROUP=globalstar&FORMAT=csv", - "GNSS" to "https://celestrak.org/NORAD/elements/gp.php?GROUP=gnss&FORMAT=csv", - "Intelsat" to "https://celestrak.org/NORAD/elements/gp.php?GROUP=intelsat&FORMAT=csv", - "Iridium" to "https://celestrak.org/NORAD/elements/gp.php?GROUP=iridium-NEXT&FORMAT=csv", - "Military" to "https://celestrak.org/NORAD/elements/gp.php?GROUP=military&FORMAT=csv", - "New" to "https://celestrak.org/NORAD/elements/gp.php?GROUP=last-30-days&FORMAT=csv", - "OneWeb" to "https://celestrak.org/NORAD/elements/gp.php?GROUP=oneweb&FORMAT=csv", - "Orbcomm" to "https://celestrak.org/NORAD/elements/gp.php?GROUP=orbcomm&FORMAT=csv", - "Resource" to "https://celestrak.org/NORAD/elements/gp.php?GROUP=resource&FORMAT=csv", - "CelesTrak SatNOGS" to "https://celestrak.org/NORAD/elements/gp.php?GROUP=satnogs&FORMAT=csv", - "Science" to "https://celestrak.org/NORAD/elements/gp.php?GROUP=science&FORMAT=csv", - "Spire" to "https://celestrak.org/NORAD/elements/gp.php?GROUP=spire&FORMAT=csv", - "Starlink" to "https://celestrak.org/NORAD/elements/gp.php?GROUP=starlink&FORMAT=csv", - "Swarm" to "https://celestrak.org/NORAD/elements/gp.php?GROUP=swarm&FORMAT=csv", - "Weather" to "https://celestrak.org/NORAD/elements/gp.php?GROUP=weather&FORMAT=csv", - "X-Comm" to "https://celestrak.org/NORAD/elements/gp.php?GROUP=x-comm&FORMAT=csv", - "Amsat" to "https://amsat.org/tle/current/nasabare.txt", - "Classified" to "https://www.mmccants.org/tles/classfd.zip", - "McCants" to "https://www.mmccants.org/tles/inttles.zip", - "ARISS" to "https://live.ariss.org/iss.txt", "Other" to "" // key for sats filter ) + // Transceiver sources. Both publish the same SatNOGS-uuid records (measured 2026-10-04: + // 2760 shared uuids), and the sync keeps the FIRST source's copy for a shared uuid + // (distinctBy { uuid }). SatNOGS is kept first on purpose: its copies carry the + // up-to-date descriptions (e.g. AO-91 "no CTCSS any longer") and it is the only source + // with the newest satellites' transmitters (T-18 objects etc.), while R4UAB mainly adds + // long-dead entries plus a handful of live extras. Upstream lists R4UAB first; this fork + // intentionally differs. val transceiversDataUrls = mapOf( "SatNOGS" to "https://db.satnogs.org/api/transmitters/?format=json&status=active", "R4UAB" to "https://r4uab.ru/transmitters.json" @@ -78,4 +69,12 @@ object Sources { * per-type IDs, and are mutually exclusive with the regular TLE-source * types in the picker. */ val virtualTypeNames = listOf("AMSAT Live FM", "AMSAT Live Linear", "Live SSTV") + + /** Key of the CelesTrak "active" group source in [satelliteDataUrls] — the whole + * catalogue. Selecting it means "all satellites", so when its persisted id list + * is empty the picker must fall back to no filtering instead of showing an empty + * list. The list can legitimately be empty: CelesTrak answers 403 ("GP data has + * not updated since your last successful download", groups update every 2 hours) + * when a group is re-requested, and the sync then persists nothing for that type. */ + val allSourceType = "All" }