Allow converting a video to a music track without losing views/URL
VideoController@update() now handles a replacement media file: if the
new file is audio the row is forced to type=music and, when the on-disk
type folder differs from the declared type (e.g. a video sitting under
users/{u}/videos/ that was later marked music), the media is relocated
into the canonical users/{u}/music/{slug}/tracks/{lang}-{id}/audio.ext
layout. Old primary file and stale meta.json are deleted from NAS; HLS
and slideshow caches are reset. The same relocation is applied by
replaceFile() so the mobile "Replace Media File" flow behaves the same.
Slide- and audio-track-management gates in update() also switched from
isAudioOnlyFile() (extension-based) to the declared type, so secondary
tracks and cover slides added mid-conversion are no longer silently
dropped. The edit modal now renders existing secondary tracks whenever
type=music regardless of the primary file extension.
Also carries an unrelated app.blade.php tweak: the mobile filter bar's
sticky reset moved from .yt-filter-bar to its wrapper, with padding
kept on the inner bar.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
This commit is contained in:
1 parent
da714958c6
commit
3d8d7b8efe
3 files changed
+196
-6
No files matched your search
@@ -1198,12 +1198,15 @@
|
||||
}
|
||||
body.has-impersonate-bar .yt-main { top: calc(56px + 40px) !important; }
|
||||
.yt-main.video-view-page { padding: 0 !important; }
|
||||
.yt-filter-bar {
|
||||
.yt-filter-bar-wrap {
|
||||
position: relative !important;
|
||||
top: auto !important;
|
||||
z-index: auto !important;
|
||||
margin: -16px -16px 16px !important;
|
||||
}
|
||||
.yt-filter-bar {
|
||||
padding: 12px 16px !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
@@ -288,8 +288,9 @@ function openEditVideoModal(videoId) {
|
||||
_editSlidesData['t1'] = (v.slides || []).map(s => ({ id: s.id, url: s.url }));
|
||||
_editRenderSlides('t1');
|
||||
|
||||
// Extra tracks
|
||||
if (v.is_audio && v.audio_tracks) {
|
||||
// Extra tracks — show whenever the row is declared music, even if the
|
||||
// primary file is still a video (mid-conversion state).
|
||||
if ((v.type === 'music' || v.is_audio) && v.audio_tracks) {
|
||||
v.audio_tracks.forEach(track => _editAddExistingTrack(track));
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user