Skip to content

Refactor: Where possible, utilise native xq flags for XML parsing and extraction#406

Draft
Crosenhain wants to merge 4 commits intoRandomNinjaAtk:mainfrom
Crosenhain:xq-fixes
Draft

Refactor: Where possible, utilise native xq flags for XML parsing and extraction#406
Crosenhain wants to merge 4 commits intoRandomNinjaAtk:mainfrom
Crosenhain:xq-fixes

Conversation

@Crosenhain
Copy link

This PR updates the XML parsing logic across all scripts (Lidarr, Radarr, Readarr, Sonarr, and Universal) to use xq's built-in extraction flags rather than piping outputs through jq, wherever possible. Where it isn't possible (eg. where jq handles things better), tell xq to output json using the -j flag.

Key Changes:

  • Replaced some jq pipelines with xq -x for direct XPath queries (e.g., extracting Plex versions and config.xml values).
  • Use the -j flag for xq to output JSON, so that jq can be utilised to parse Plex library data.
  • Simplifies the command structures by reducing reliance on secondary jq processes where xq can handle the extraction natively.

@Crosenhain
Copy link
Author

Hmm this actually appears to be a difference in xq versions between my lidarr and *arr instances that caused me to look at this in the first place...

@Crosenhain Crosenhain marked this pull request as draft February 24, 2026 00:34
@Crosenhain
Copy link
Author

I dug a bit more, the xq and yq packages are probably the wrong ones to use.

I did discover that the yq-python package allows the original functions.bash script to function correctly in all cases, so that may well be the solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant