fix assets copy, load correct storage for media page
This commit is contained in:
parent
a842c78d99
commit
9042e92f96
@ -13,9 +13,6 @@ COPY <<-EOT /run.sh
|
||||
|
||||
if [ ! -f /db/ffplayout.db ]; then
|
||||
ffplayout -i -u admin -p admin -m contact@example.com --storage "/tv-media" --playlists "/playlists" --public "/public" --logs "/logging" --mail-smtp "mail.example.org" --mail-user "admin@example.org" --mail-password "abcd" --mail-starttls
|
||||
|
||||
mkdir /tv-media/1
|
||||
cp -r /00-assets /tv-media/1/
|
||||
fi
|
||||
|
||||
/usr/bin/ffplayout -l "0.0.0.0:8787"
|
||||
@ -31,8 +28,8 @@ RUN [[ -f "/tmp/ffplayout-v${FFPLAYOUT_VERSION}_x86_64-unknown-linux-musl.tar.gz
|
||||
cd /tmp && \
|
||||
tar xf "ffplayout-v${FFPLAYOUT_VERSION}_x86_64-unknown-linux-musl.tar.gz" && \
|
||||
cp ffplayout /usr/bin/ && \
|
||||
mkdir /00-assets && \
|
||||
cp assets/dummy.vtt assets/logo.png assets/DejaVuSans.ttf assets/FONT_LICENSE.txt /00-assets/ && \
|
||||
mkdir -p /usr/share/ffplayout/ && \
|
||||
cp assets/dummy.vtt assets/logo.png assets/DejaVuSans.ttf assets/FONT_LICENSE.txt /usr/share/ffplayout/ && \
|
||||
rm -rf /tmp/* && \
|
||||
mkdir ${DB}
|
||||
|
||||
|
@ -15,9 +15,6 @@ COPY <<-EOT /run.sh
|
||||
|
||||
if [ ! -f /db/ffplayout.db ]; then
|
||||
ffplayout -i -u admin -p admin -m contact@example.com --storage "/tv-media" --playlists "/playlists" --public "/public" --logs "/logging" --mail-smtp "mail.example.org" --mail-user "admin@example.org" --mail-password "abcd" --mail-starttls
|
||||
|
||||
mkdir /tv-media/1
|
||||
cp -r /00-assets /tv-media/1/
|
||||
fi
|
||||
|
||||
/usr/bin/ffplayout -l "0.0.0.0:8787"
|
||||
@ -33,8 +30,8 @@ RUN [[ -f "/tmp/ffplayout-v${FFPLAYOUT_VERSION}_x86_64-unknown-linux-musl.tar.gz
|
||||
cd /tmp && \
|
||||
tar xf "ffplayout-v${FFPLAYOUT_VERSION}_x86_64-unknown-linux-musl.tar.gz" && \
|
||||
cp ffplayout /usr/bin/ && \
|
||||
mkdir /00-assets && \
|
||||
cp assets/dummy.vtt assets/logo.png assets/DejaVuSans.ttf assets/FONT_LICENSE.txt /00-assets/ && \
|
||||
mkdir -p /usr/share/ffplayout/ && \
|
||||
cp assets/dummy.vtt assets/logo.png assets/DejaVuSans.ttf assets/FONT_LICENSE.txt /usr/share/ffplayout/ && \
|
||||
rm -rf /tmp/* && \
|
||||
mkdir ${DB}
|
||||
|
||||
|
@ -205,9 +205,6 @@ COPY <<-EOT /run.sh
|
||||
|
||||
if [ ! -f /db/ffplayout.db ]; then
|
||||
ffplayout -i -u admin -p admin -m contact@example.com --storage "/tv-media" --playlists "/playlists" --public "/public" --logs "/logging" --mail-smtp "mail.example.org" --mail-user "admin@example.org" --mail-password "abcd" --mail-starttls
|
||||
|
||||
mkdir /tv-media/1
|
||||
cp -r /00-assets /tv-media/1/
|
||||
fi
|
||||
|
||||
/usr/bin/ffplayout -l "0.0.0.0:8787"
|
||||
@ -220,8 +217,8 @@ RUN [[ -f "/tmp/ffplayout-v${FFPLAYOUT_VERSION}_x86_64-unknown-linux-musl.tar.gz
|
||||
cd /tmp && \
|
||||
tar xf "ffplayout-v${FFPLAYOUT_VERSION}_x86_64-unknown-linux-musl.tar.gz" && \
|
||||
cp ffplayout /usr/bin/ && \
|
||||
mkdir /00-assets && \
|
||||
cp assets/dummy.vtt assets/logo.png assets/DejaVuSans.ttf assets/FONT_LICENSE.txt /00-assets/ && \
|
||||
mmkdir -p /usr/share/ffplayout/ && \
|
||||
cp assets/dummy.vtt assets/logo.png assets/DejaVuSans.ttf assets/FONT_LICENSE.txt /usr/share/ffplayout/ && \
|
||||
rm -rf /tmp/* && \
|
||||
mkdir ${DB}
|
||||
|
||||
|
@ -35,14 +35,8 @@ pub async fn create_channel(
|
||||
target_channel: Channel,
|
||||
) -> Result<Channel, ServiceError> {
|
||||
let channel = handles::insert_channel(conn, target_channel).await?;
|
||||
let storage_path = PathBuf::from(channel.storage.clone());
|
||||
|
||||
handles::new_channel_presets(conn, channel.id).await?;
|
||||
|
||||
if let Err(e) = copy_assets(&storage_path).await {
|
||||
error!("{e}");
|
||||
};
|
||||
|
||||
handles::update_channel(conn, channel.id, channel.clone()).await?;
|
||||
|
||||
let output_param = "-c:v libx264 -crf 23 -x264-params keyint=50:min-keyint=25:scenecut=-1 -maxrate 1300k -bufsize 2600k -preset faster -tune zerolatency -profile:v Main -level 3.1 -c:a aac -ar 44100 -b:a 128k -flags +cgop -f hls -hls_time 6 -hls_list_size 600 -hls_flags append_list+delete_segments+omit_endlist -hls_segment_filename live/stream-%d.ts live/stream.m3u8".to_string();
|
||||
@ -52,7 +46,11 @@ pub async fn create_channel(
|
||||
|
||||
let config = get_config(conn, channel.id).await?;
|
||||
let m_queue = Arc::new(Mutex::new(MailQueue::new(channel.id, config.mail.clone())));
|
||||
let manager = ChannelManager::new(Some(conn.clone()), channel.clone(), config);
|
||||
let manager = ChannelManager::new(Some(conn.clone()), channel.clone(), config.clone());
|
||||
|
||||
if let Err(e) = copy_assets(&PathBuf::from(&config.storage.path)).await {
|
||||
error!("{e}");
|
||||
};
|
||||
|
||||
controllers
|
||||
.lock()
|
||||
|
@ -336,7 +336,7 @@ pub async fn copy_assets(storage_path: &Path) -> Result<(), std::io::Error> {
|
||||
let font_target = target.join("DejaVuSans.ttf");
|
||||
let logo_target = target.join("logo.png");
|
||||
|
||||
fs::create_dir(&target).await?;
|
||||
fs::create_dir_all(&target).await?;
|
||||
fs::copy(&dummy_source, &dummy_target).await?;
|
||||
fs::copy(&font_source, &font_target).await?;
|
||||
fs::copy(&logo_source, &logo_target).await?;
|
||||
@ -365,6 +365,8 @@ pub async fn copy_assets(storage_path: &Path) -> Result<(), std::io::Error> {
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
error!("Storage path {storage_path:?} not exists!");
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
@ -116,6 +116,7 @@ const { t } = useI18n()
|
||||
|
||||
const authStore = useAuth()
|
||||
const configStore = useConfig()
|
||||
const mediaStore = useMedia()
|
||||
const indexStore = useIndex()
|
||||
const { i } = storeToRefs(useConfig())
|
||||
|
||||
@ -220,6 +221,7 @@ async function addUpdateChannel() {
|
||||
await configStore.getAdvancedConfig()
|
||||
await configStore.getPlayoutConfig()
|
||||
await configStore.getUserConfig()
|
||||
await mediaStore.getTree('')
|
||||
}
|
||||
}
|
||||
|
||||
@ -244,6 +246,7 @@ async function deleteChannel() {
|
||||
await configStore.getAdvancedConfig()
|
||||
await configStore.getPlayoutConfig()
|
||||
await configStore.getUserConfig()
|
||||
await mediaStore.getTree('')
|
||||
|
||||
if (response.status === 200) {
|
||||
indexStore.msgAlert('success', t('config.errorChannelDelete'), 2)
|
||||
|
Loading…
Reference in New Issue
Block a user