Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions script_library/index.json
Original file line number Diff line number Diff line change
@@ -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": [
{
Expand Down Expand Up @@ -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
}
]
}
18 changes: 18 additions & 0 deletions script_library/scripts/basic/script_mngbfc3s.py
Original file line number Diff line number Diff line change
@@ -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}')
Loading