From 17fe6ba2a4ad45139a4523f04641fb8669d5d2ec Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 18 Aug 2026 13:54:52 -0700 Subject: [PATCH 1/3] plex, add test code for automatically concatting chunks. --- bashrc.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/bashrc.sh b/bashrc.sh index dd5ef5f..fc0a04f 100755 --- a/bashrc.sh +++ b/bashrc.sh @@ -375,6 +375,20 @@ function pull-plex { go-root cp -Rv "$plex_dir"/{1,2}/* "$dest" + + # TBD: Needs tested. + cd "$dest" + ls | while read dir; do + cd $dir + if [[ -e *.chunk0 ]]; then + final="movie.mkv" + echo "Catting files together to make '$final'." + ls -lh *.chunk* + cat *.chunk* > $final + ls -lh $final + fi + cd .. + done } From dc3bdb1c821b611ce9e1d9a2658136253a650563 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 18 Aug 2026 13:58:42 -0700 Subject: [PATCH 2/3] plex, add automatic cleanup of the chunk files since this is not their source location. --- bashrc.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bashrc.sh b/bashrc.sh index fc0a04f..96ba2a6 100755 --- a/bashrc.sh +++ b/bashrc.sh @@ -384,8 +384,11 @@ function pull-plex { final="movie.mkv" echo "Catting files together to make '$final'." ls -lh *.chunk* + cat *.chunk* > $final ls -lh $final + + rm -v *.chunk* fi cd .. done From 76fa85cbc004b157b5f7bfc7be73093e0c77e9de Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 18 Aug 2026 14:12:58 -0700 Subject: [PATCH 3/3] plex, tested the code on local machine. --- bashrc.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bashrc.sh b/bashrc.sh index 96ba2a6..d3825d2 100755 --- a/bashrc.sh +++ b/bashrc.sh @@ -379,11 +379,13 @@ function pull-plex { # TBD: Needs tested. cd "$dest" ls | while read dir; do - cd $dir - if [[ -e *.chunk0 ]]; then + echo "Checking '$dir'" + cd "$dir" + ls -lh + # Unsure why -e and -f don't work here. Spaces in filenames? Globs? + if [[ `ls *.chunk0 2>/dev/null` ]]; then final="movie.mkv" echo "Catting files together to make '$final'." - ls -lh *.chunk* cat *.chunk* > $final ls -lh $final