[PR #129] [MERGED] [downloader] Keep every video when a post has several of them #133

Closed
opened 2026-10-13 19:47:46 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Glitchy-Sheep/boosty-downloader/pull/129
Author: @Glitchy-Sheep
Created: 8/9/2026
Status: ✅ Merged
Merged: 8/9/2026
Merged by: @Glitchy-Sheep

Base: main ← Head: fix/unique-video-filenames


📝 Commits (2)

  • c702fad fix: 🐛 Boosty video chunks carry their unique API id
  • e8d3728 fix: 🐛 Multiple videos in one post no longer overwrite each other

📊 Changes

7 files changed (+46 additions, -1 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 boosty_downloader/src/application/mappers/ok_boosty_video.py (+1 -0)
📝 boosty_downloader/src/application/use_cases/download_single_post.py (+7 -1)
📝 boosty_downloader/src/domain/post_data_chunks.py (+3 -0)
📝 boosty_downloader/src/infrastructure/boosty_api/models/post/post_data_types/post_data_ok_video.py (+1 -0)
📝 test/unit/mappers/post_mapper_test.py (+2 -0)
➕ test/unit/use_cases/video_filename_test.py (+31 -0)

📄 Description

Summary

A post with two or more videos used to end up with a single file: all of them were written under the same name, and the last one won. Now every video filename carries the video id, so names cannot collide.

Fixes #104

Problem

  • A Boosty video file was named by its title alone
  • Videos in one post often share a title (or have none), so they all pointed at the same path
  • The file writer opens with 'wb' and overwrites without a warning - earlier videos were lost silently

Fix

  • The API sends a unique id for every video - the client now parses it and hands it down to the domain
  • Filenames become My stream (a2dd6942): the id suffix is always there, so a name never depends on the neighbouring videos
  • An empty title falls back to video (a2dd6942) instead of a bare bracket
  • The HTML page still shows the human title - the suffix lives only in the filename

Before / After

Before: a post with 3 videos leaves 1 file on disk, the other 2 are lost without a trace.
After: 3 videos - 3 files, each with a stable unique name.

Tests

  • test_videos_with_the_same_title_get_different_filenames - the #104 collision itself
  • test_empty_title_falls_back_to_video_with_id - nameless videos stay readable and unique
  • Live integration suite (6 passed) confirms the real API sends the id field on every post

Notes

  • Already-downloaded videos keep their old names: the cache works by post id, nothing gets re-downloaded
  • New downloads use the new naming - mentioned in the changelog entry

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Glitchy-Sheep/boosty-downloader/pull/129 **Author:** [@Glitchy-Sheep](https://github.com/Glitchy-Sheep) **Created:** 8/9/2026 **Status:** ✅ Merged **Merged:** 8/9/2026 **Merged by:** [@Glitchy-Sheep](https://github.com/Glitchy-Sheep) **Base:** `main` ← **Head:** `fix/unique-video-filenames` --- ### 📝 Commits (2) - [`c702fad`](https://github.com/Glitchy-Sheep/boosty-downloader/commit/c702fad21a9c12452fa24f9bd8b1895887db753f) fix: :bug: Boosty video chunks carry their unique API id - [`e8d3728`](https://github.com/Glitchy-Sheep/boosty-downloader/commit/e8d3728a2418ddac1ee09e382ac11792e813f2e4) fix: :bug: Multiple videos in one post no longer overwrite each other ### 📊 Changes **7 files changed** (+46 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `boosty_downloader/src/application/mappers/ok_boosty_video.py` (+1 -0) 📝 `boosty_downloader/src/application/use_cases/download_single_post.py` (+7 -1) 📝 `boosty_downloader/src/domain/post_data_chunks.py` (+3 -0) 📝 `boosty_downloader/src/infrastructure/boosty_api/models/post/post_data_types/post_data_ok_video.py` (+1 -0) 📝 `test/unit/mappers/post_mapper_test.py` (+2 -0) ➕ `test/unit/use_cases/video_filename_test.py` (+31 -0) </details> ### 📄 Description ## Summary A post with two or more videos used to end up with a single file: all of them were written under the same name, and the last one won. Now every video filename carries the video id, so names cannot collide. Fixes #104 ## Problem - A Boosty video file was named by its title alone - Videos in one post often share a title (or have none), so they all pointed at the same path - The file writer opens with `'wb'` and overwrites without a warning - earlier videos were lost silently ## Fix - The API sends a unique `id` for every video - the client now parses it and hands it down to the domain - Filenames become `My stream (a2dd6942)`: the id suffix is always there, so a name never depends on the neighbouring videos - An empty title falls back to `video (a2dd6942)` instead of a bare bracket - The HTML page still shows the human title - the suffix lives only in the filename ## Before / After **Before:** a post with 3 videos leaves 1 file on disk, the other 2 are lost without a trace. **After:** 3 videos - 3 files, each with a stable unique name. ## Tests - `test_videos_with_the_same_title_get_different_filenames` - the #104 collision itself - `test_empty_title_falls_back_to_video_with_id` - nameless videos stay readable and unique - Live integration suite (6 passed) confirms the real API sends the `id` field on every post ## Notes - Already-downloaded videos keep their old names: the cache works by post id, nothing gets re-downloaded - New downloads use the new naming - mentioned in the changelog entry --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-13 19:47:46 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Glitchy-Sheep/boosty-downloader#133
No description provided.