From 5b3d72f3dae8c48adc7e94b02cc3a7b3166073f8 Mon Sep 17 00:00:00 2001 From: tcely Date: Thu, 27 Mar 2025 10:04:07 -0400 Subject: [PATCH 1/9] Tweak the step name --- .github/actions/string-case/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/string-case/action.yml b/.github/actions/string-case/action.yml index 4b4c2ada..cadcb74b 100644 --- a/.github/actions/string-case/action.yml +++ b/.github/actions/string-case/action.yml @@ -20,7 +20,7 @@ outputs: runs: using: 'composite' steps: - - name: Retrieve releases + - name: Set outputs id: 'set' env: INPUT_STRING: '${{ inputs.string }}' From 5757455b46aa81b705c3045ccf9fdd2ea0b867ff Mon Sep 17 00:00:00 2001 From: tcely Date: Thu, 27 Mar 2025 10:15:25 -0400 Subject: [PATCH 2/9] Create variables.inc.sh --- .github/sh/library/variables.inc.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .github/sh/library/variables.inc.sh diff --git a/.github/sh/library/variables.inc.sh b/.github/sh/library/variables.inc.sh new file mode 100644 index 00000000..a5ac4ce0 --- /dev/null +++ b/.github/sh/library/variables.inc.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env sh + +# For setting single line variables in the environment or output +set_sl_var() { local f='%s=%s\n' ; printf -- "${f}" "$@" ; } ; + +# Used together to set multiple line variables in the environment or output +mk_delim() { printf -- '"%s_EOF_%d_"' "$1" "${RANDOM}" ; } ; +open_ml_var() { local f=''\%'s<<'\%'s\n' ; printf -- "${f}" "$2" "$1" ; } ; +close_ml_var() { local f='%s\n' ; printf -- "${f}" "$1" ; } ; + From ffd6edd913fccc82c42d0f59588e848cfe1d7a23 Mon Sep 17 00:00:00 2001 From: tcely Date: Thu, 27 Mar 2025 10:23:00 -0400 Subject: [PATCH 3/9] Clean up the `.json` file and log the results --- .github/workflows/ci.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 199f2d82..5bd6d8b7 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -104,6 +104,8 @@ jobs: close_ml_var "${delim}" "${var}" ; unset -v delim jq_arg var ; } >> "${GITHUB_ENV}" + cat -v "${GITHUB_ENV}" + rm -v -f .ffmpeg.releases.json - name: Set up QEMU uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx From 9d9c549275694d25f44ac8920cbf85b4dc91d4a0 Mon Sep 17 00:00:00 2001 From: tcely Date: Thu, 27 Mar 2025 10:25:11 -0400 Subject: [PATCH 4/9] Run all the jobs --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5bd6d8b7..e0f6f7f7 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -19,7 +19,7 @@ on: jobs: info: - if: ${{ !cancelled() && 'pull_request' != github.event_name }} + #if: ${{ !cancelled() && 'pull_request' != github.event_name }} runs-on: ubuntu-latest outputs: ffmpeg-releases: ${{ steps.ffmpeg.outputs.releases }} From 60596b04eb933f99e9b54e1bffbe51e876f89631 Mon Sep 17 00:00:00 2001 From: tcely Date: Thu, 27 Mar 2025 10:34:19 -0400 Subject: [PATCH 5/9] Test if GitHub parses like shell does or not --- .github/workflows/ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e0f6f7f7..1e7b3026 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -83,8 +83,8 @@ jobs: cat >| .ffmpeg.releases.json <<'EOF' ${{ needs.info.outputs.ffmpeg-releases }} EOF - mk_delim() { printf -- '"%s_EOF_%d_"' "$1" "${RANDOM}" ; } ; - open_ml_var() { local f=''\%'s<<'\%'s\n' ; printf -- "${f}" "$2" "$1" ; } ; + mk_delim() { local f='%s_EOF_%d_' ; printf -- "${f}" "$1" "${RANDOM}" ; } ; + open_ml_var() { local f=''\%'s<<"'\%'s"\n' ; printf -- "${f}" "$2" "$1" ; } ; close_ml_var() { local f='%s\n' ; printf -- "${f}" "$1" ; } ; { var='FFMPEG_DATE' ; From f1043f57eb582ed7491b4fc51954c7e28df1929a Mon Sep 17 00:00:00 2001 From: tcely Date: Thu, 27 Mar 2025 10:37:24 -0400 Subject: [PATCH 6/9] GitHub has its own weirdness --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1e7b3026..cbce9946 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -84,7 +84,7 @@ jobs: ${{ needs.info.outputs.ffmpeg-releases }} EOF mk_delim() { local f='%s_EOF_%d_' ; printf -- "${f}" "$1" "${RANDOM}" ; } ; - open_ml_var() { local f=''\%'s<<"'\%'s"\n' ; printf -- "${f}" "$2" "$1" ; } ; + open_ml_var() { local f=''\%'s<<'\%'s\n' ; printf -- "${f}" "$2" "$1" ; } ; close_ml_var() { local f='%s\n' ; printf -- "${f}" "$1" ; } ; { var='FFMPEG_DATE' ; From e9cf69e0587bb1a61260cf2aa6f46aa4d7676849 Mon Sep 17 00:00:00 2001 From: tcely Date: Thu, 27 Mar 2025 10:38:31 -0400 Subject: [PATCH 7/9] Turn off the `info` step again for pull requests --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index cbce9946..15a0bf45 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -19,7 +19,7 @@ on: jobs: info: - #if: ${{ !cancelled() && 'pull_request' != github.event_name }} + if: ${{ !cancelled() && 'pull_request' != github.event_name }} runs-on: ubuntu-latest outputs: ffmpeg-releases: ${{ steps.ffmpeg.outputs.releases }} From 73f683edc223167a074158844aca29ade26be2e4 Mon Sep 17 00:00:00 2001 From: tcely Date: Thu, 27 Mar 2025 10:44:22 -0400 Subject: [PATCH 8/9] Use a local for format like the other functions --- .github/sh/library/variables.inc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/sh/library/variables.inc.sh b/.github/sh/library/variables.inc.sh index a5ac4ce0..01a5373c 100644 --- a/.github/sh/library/variables.inc.sh +++ b/.github/sh/library/variables.inc.sh @@ -4,7 +4,7 @@ set_sl_var() { local f='%s=%s\n' ; printf -- "${f}" "$@" ; } ; # Used together to set multiple line variables in the environment or output -mk_delim() { printf -- '"%s_EOF_%d_"' "$1" "${RANDOM}" ; } ; +mk_delim() { local f='%s_EOF_%d_' ; printf -- "${f}" "$1" "${RANDOM}" ; } ; open_ml_var() { local f=''\%'s<<'\%'s\n' ; printf -- "${f}" "$2" "$1" ; } ; close_ml_var() { local f='%s\n' ; printf -- "${f}" "$1" ; } ; From 129ccca2582dc3afc872fb395a7565a51bd99dab Mon Sep 17 00:00:00 2001 From: tcely Date: Thu, 27 Mar 2025 21:39:59 -0400 Subject: [PATCH 9/9] Handle strings better --- tubesync/sync/fields.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tubesync/sync/fields.py b/tubesync/sync/fields.py index 2910b7cc..2f479b68 100644 --- a/tubesync/sync/fields.py +++ b/tubesync/sync/fields.py @@ -145,6 +145,9 @@ class CommaSepChoiceField(models.CharField): # The data was lost; we can regenerate it. args_dict = {key: self.__dict__[key] for key in CommaSepChoice._fields} args_dict['selected_choices'] = list(value) + # setting a string manually should not result in characters + if isinstance(value, str) and len(value) > 0: + args_dict['selected_choices'] = value.split(self.separator) data = CommaSepChoice(**args_dict) value = data.selected_choices s_value = super().get_prep_value(value)