Repository navigation
Conversation
…ed task progress Media library - Merge mode now walks every folder level instead of only the first one. A folder that directly contains media files is one collection and is not split further; a folder without media is descended into. Loose files in the scan root stay individual items. Depth is capped at 16. - Scanning no longer buffers the whole tree before writing: items are flushed to the database every 20 items or 3 seconds, for all four media types, so results appear while the scan is still running. Skipped and failed items still advance the progress counter. - The scan path type tag now decides movie vs. series. Tags such as TV series / anime / variety / documentary mark every video under the path as "tv" (shown as series in Emby, also for single files); movie tags force "movie" even when merge mode is on. Unrecognised tags keep the old rule (folder items are series). Emby virtual folders use the same rule. - Fix: a music folder containing a non-audio file was dropped entirely. Playback URL - When no site_url is configured and the request host is a loopback address (127.0.0.1 / localhost / ::1), stream_url now returns relative /d and /p paths instead of absolute loopback URLs. An explicit site_url or a forwarded host still produces absolute URLs. Seed tasks - Seed generation reports progress by bytes hashed plus a stage message and is exposed at /task/seed_generate. - Seed save, rapid upload and transit transfer register a display-only task at /task/seed_save (the operation stays synchronous) so progress is visible in the task list. Tests cover tag classification, index-length checks, level-by-level merge scanning (stop at collection, list errors, depth limit) and loopback detection. Co-Authored-By: Claude <noreply@anthropic.com>
PIKACHUIM
marked this pull request as draft
October 26, 2026 10:52
This was referenced Oct 27, 2026
9 of 10 tasks
added 2 commits
October 27, 2026 17:47
site_url 允许配置成 /openlist 这样的路径前缀;原先只有以 http 开头才走绝对地址,前缀模式下播放地址会丢掉前缀导致 404。改为配置了 site_url 就统一用 GetApiUrlFromRequest 生成。
…p export - 扫描:季目录(第N季/Season N/S01)解析季号写入 EpisodeInfo.season,Emby 与播放器可按季分组;显式电影标签不再被季目录反推成剧集;merge_depth 语义固定为「第 N 层=一条记录」,与模型注释、UI 一致 - 刮削:音乐条目的文件自带封面(data:/thumb:/站内地址)不再被在线封面覆盖 - 后台新增:封面 URL/上传(/admin/media/items/cover)、专辑聚合列表与批量编辑(/admin/media/albums、/album/items、/album/update)、条目可编辑字段扩充(选集/视频类型/季集/时长/外部ID) - 导入导出升级为 zip(media_export.json + covers/),导入兼容旧 JSON - Emby:多季合集按每集 season 拆分 Season,集 ID 带季号避免跨季重号 - fix(seed):中转转存部分文件失败时任务按失败收尾,不再一律标记成功
PIKACHUIM
marked this pull request as ready for review
October 27, 2026 09:53
…te, concurrent cover export - UpdateMediaItemAdmin 改为 PATCH 语义(字段全部指针,只写出现过的键),修复只传 hidden 也会清空 cover/plot 的问题;cover 增加 12MB 上限 - 专辑批量更新走单事务(新增 db.UpdateMediaItems),失败整批回滚;旧封面文件在事务成功后才删除 - 导出封面改为并发读取(4 并发,单张 8MB / 总量 512MB / 5000 张上限),避免大库导出逐张串行
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR:OpenList-Backends(OpenList)
Summary / 摘要
补齐媒体库的扫描规则、刮削保护、后台管理接口与 Emby 兼容,并修复
site_url带路径前缀时播放地址丢前缀的问题。前端配套改动见 OpenList-Frontend 仓库同名分支。用户可感知的变化
merge_depth:扫描根的直接子目录是第 1 层,/影视/群星/{第一季,第二季}填 1 即聚合成一条「群星」;.iso原盘镜像。episode.season,播放器与 Emby 可按季分组;显式标「电影」的扫描路径不会被季目录反推成剧集。site_url配置为/openlist这类路径前缀时不再丢前缀(此前会 404)。重要实现变化
internal/media/scanner.go:walkMergeFolders增量扫描、walkMergeDepth固定层级、季目录识别与上移promoteSeasonTarget;.iso扩展名、buildEpisodesFromFolder递归与相对路径;video_type判定链:显式类型标签 > 季目录证据 > 文件夹/单文件兜底。internal/model/media.go:EpisodeInfo增加season;MergeDepth注释与实现对齐。internal/db/media.go:ListMediaItemsByAlbum、ListAlbums固定排序(分页稳定)、重扫保留video_type;新增 upsert 单测。POST /api/admin/media/items/cover(media_cover_upload.go,落<data>/<thumbnail_path>/cover-<id>-<ts>.<ext>,返回thumb:/引用);GET /api/admin/media/albums、GET /api/admin/media/album/items、POST /api/admin/media/album/update(media_album.go,专辑为聚合分组,批量写回该专辑所有曲目);media_export.go:media_export.json+covers/)。episodesOf / seasonList / findEpisode改用episodeSeasonOf,集 ID 变为ep-<itemID>-<season>-<num>(兼容旧 3 段解析)。SeedSaveTask进度任务 + 生成/保存进度上报;中转转存逐文件失败会聚合为任务失败(此前无条件标记成功)。server/common/base.go:配置了site_url一律走GetApiUrlFromRequest。兼容性
导出格式升到 v2(zip),导入同时兼容 v2 zip 与 v1 纯 JSON。
EpisodeInfo增加可选season字段(JSONseason,omitempty),旧数据无影响。Emby 集 ID 格式变化:老客户端若缓存了旧 ID,需要重新拉取列表。
新增后台路由均为增量接口,不改动既有公开 API。
This PR has breaking changes.
/ 此 PR 包含破坏性变更。(Emby 集 ID 格式变化,见上)
This PR changes public API, config, storage format, or migration behavior.
/ 此 PR 修改了公开 API、配置、存储格式或迁移行为。(导出格式 v2、
EpisodeInfo.season、Emby 集 ID)This PR requires corresponding changes in related repositories.
/ 此 PR 需要关联仓库同步修改。
Related repository PRs / 关联仓库 PR:
<前端 PR 链接>Related Issues / 关联 Issue
Relates to #3297
Testing / 测试
go build ./...go test ./internal/media ./internal/db ./server/handles ./server/commonTestSeasonNumberOf、TestPromoteSeasonTarget、TestIsSeasonDirTestWalkMergeDepthTargetsShowLevel / SeasonLevel / DeeperLevel、TestBuildEpisodesKeepsSubPathTestMediaExportZipRoundTrip(zip 导出→导入逐字节比对封面)、TestCoverFileExtRejectsNonImage、TestIsFileOwnedCoverCreateOrUpdateMediaItem重扫保留字段(internal/db/media_item_upsert_test.go)GetPlaybackBase路径前缀(server/common/base_test.go)/影视资源/群星/{第一季,第二季}产出单条「群星」,8 集分两季,Emby 侧两个 Season;covers/,重新导入封面回填为thumb:/...。Checklist / 检查清单
/ 我已阅读 CONTRIBUTING。
/ 我确认此贡献符合仓库许可证、贡献规范和行为准则。
gofmt,go fmt, orprettierwhere applicable./ 我已按适用情况使用
gofmt、go fmt或prettier格式化变更代码。/ 我已在适用情况下请求相关维护者或代码所有者审查。
AI Disclosure / AI 使用声明
/ 此 PR 包含 AI 辅助内容。
Tools used / 使用工具:
Usage scope / 使用范围:
Code generation / 代码生成
Refactoring / 重构
Documentation / 文档
Tests / 测试
Translation / 翻译
Review assistance / 审查辅助
I have reviewed and validated all AI-assisted content included in this PR.
/ 我已审核并验证此 PR 中的所有 AI 辅助内容。
I have ensured that all AI-assisted commits include
Co-Authored-Byattribution./ 我已确保所有 AI 辅助提交都包含
Co-Authored-By归属信息。(当前提交未附加 trailer,如需合规请补 trailer 后 force-push)I can reproduce all AI-assisted content included in this PR without any AI tools.
/ 我可以在没有任何 AI 工具的情况下重现此 PR 中包含的所有 AI 辅助内容。