v0.50.0: exports report the finished folder's size

This commit is contained in:
2026-10-10 23:48:03 -07:00
parent 3dcd30eab6
commit 96fac71075
4 changed files with 42 additions and 4 deletions
+1 -1
View File
@@ -1,3 +1,3 @@
"""LinTunes — iTunes-style music library manager and player for Linux."""
__version__ = "0.49.1"
__version__ = "0.50.0"
+14
View File
@@ -235,6 +235,19 @@ def build_index_html(plan: ExportPlan, image_names) -> str:
)
def folder_size(path: Path) -> int:
"""Bytes in every file under `path` — what the exported folder weighs,
conversions, page and images included."""
total = 0
for p in Path(path).rglob("*"):
try:
if p.is_file():
total += p.stat().st_size
except OSError:
pass
return total
class _Cancelled(Exception):
"""Internal: unwinds _run when cancel() was requested."""
@@ -352,6 +365,7 @@ class ExportWorker(QObject):
"converted": converted,
"skipped": len(plan.skipped),
"vanished": len(vanished),
"bytes": folder_size(plan.dest_dir),
})
except _Cancelled:
if dest is not None:
+7 -3
View File
@@ -1086,7 +1086,8 @@ class MainWindow(QMainWindow):
self._web_progress.complete(
web_progress.EXPORT,
f"{summary['exported']} track"
f"{'s' if summary['exported'] != 1 else ''}")
f"{'s' if summary['exported'] != 1 else ''} · "
f"{device_sync.format_bytes(summary.get('bytes', 0))}")
self._web_progress.begin(web_progress.UPLOAD, "Starting…")
self._upload_worker = upload.UploadWorker(
run["host"], run["plan"].dest_dir, run["rdir"], self)
@@ -1124,7 +1125,8 @@ class MainWindow(QMainWindow):
web_progress.UPLOAD,
f"{sent} file{'s' if sent != 1 else ''} sent")
summary = run.get("export", {})
msg = (f"Uploaded “{summary.get('playlist', run['slug'])}” to "
msg = (f"Uploaded “{summary.get('playlist', run['slug'])}” "
f"({device_sync.format_bytes(summary.get('bytes', 0))}) to "
f"{run['host']}:{run['rdir']}")
extras = []
if summary.get("converted"):
@@ -1268,7 +1270,9 @@ class MainWindow(QMainWindow):
self._hide_sync_widgets()
what = "web mix" if summary["kind"] == exporter.WEB else "folder"
msg = (f"Exported “{summary['playlist']}” as a {what}: "
f"{summary['exported']} tracks → {summary['dest']}")
f"{summary['exported']} tracks, "
f"{device_sync.format_bytes(summary.get('bytes', 0))} → "
f"{summary['dest']}")
if summary["converted"]:
msg += f", {summary['converted']} converted to FLAC"
if summary["skipped"]: