From 01d650cdeaf7ceef10a13ea4206f603a8d2b1e17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=8A=E6=99=9A=E6=89=93=E8=80=81=E8=99=8E?= Date: Thu, 2 Apr 2026 01:24:15 +0800 Subject: [PATCH 1/2] =?UTF-8?q?[=E6=8A=95=E7=A8=BF]=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E8=84=9A=E6=9C=AC:=20=E7=85=A7=E7=89=87=E7=BB=9F=E8=AE=A1=20?= =?UTF-8?q?=E2=80=94=20by=20=E4=BB=8A=E6=99=9A=E6=89=93=E8=80=81=E8=99=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scripts/basic/script_mngbfc3s.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 script_library/scripts/basic/script_mngbfc3s.py diff --git a/script_library/scripts/basic/script_mngbfc3s.py b/script_library/scripts/basic/script_mngbfc3s.py new file mode 100644 index 0000000..e737ac9 --- /dev/null +++ b/script_library/scripts/basic/script_mngbfc3s.py @@ -0,0 +1,18 @@ +import photos +from collections import Counter +import datetime + +assets = photos.get_assets(media_type='photo', limit=0) +print(f'共 {len(assets)} 张照片') + +year_counter = Counter() +for asset in assets: + ts = asset.creation_date + if ts: + year = datetime.datetime.fromtimestamp(ts).year + year_counter[year] += 1 + +print('\n按年份分布:') +for year in sorted(year_counter): + bar = '█' * (year_counter[year] // 10) + print(f'{year}: {year_counter[year]:4d} 张 {bar}') \ No newline at end of file From eeef904865c5835e23a4a970fd315004bbb675f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=8A=E6=99=9A=E6=89=93=E8=80=81=E8=99=8E?= Date: Thu, 2 Apr 2026 01:24:20 +0800 Subject: [PATCH 2/2] =?UTF-8?q?[=E6=8A=95=E7=A8=BF]=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=20index.json:=20=E6=B7=BB=E5=8A=A0=20=E7=85=A7=E7=89=87?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script_library/index.json | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/script_library/index.json b/script_library/index.json index ef13d1c..32755a1 100644 --- a/script_library/index.json +++ b/script_library/index.json @@ -1,7 +1,7 @@ { "format_version": 1, - "data_version": 50, - "updated": "2026-04-01T16:23:30.391Z", + "data_version": 51, + "updated": "2026-04-01T17:24:19.806Z", "announcement": null, "categories": [ { @@ -1214,6 +1214,29 @@ "updated": null, "status": "active", "lines": 499 + }, + { + "id": "script_mngbfc3s", + "name": "照片统计", + "name_en": "照片统计", + "desc": "运行可以直接统计你相册有多少照片", + "desc_en": "运行可以直接统计你相册有多少照片", + "category": "basic", + "file": "scripts/basic/script_mngbfc3s.py", + "thumbnail": null, + "version": 1, + "file_type": "py", + "author": "今晚打老虎", + "author_en": "今晚打老虎", + "tags": [ + "community" + ], + "requires": [], + "min_app_version": "1.5.0", + "added": "2026-04-01", + "updated": null, + "status": "active", + "lines": 18 } ] }