- Added comprehensive documentation for the ViewIt Plugin System, detailing the plugin loading process, required methods, optional features, and community extension workflow. - Updated project notes to reflect the current structure, build process, search logic, and known issues. - Introduced new build scripts for installing the add-on and creating ZIP packages. - Added test scripts for TMDB API integration, including argument parsing and logging functionality. - Enhanced existing plugins with improved search logic and error handling.
43 lines
996 B
Bash
Executable File
43 lines
996 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
INSTALL_DIR="${ROOT_DIR}/dist"
|
|
SRC_ADDON_DIR="${ROOT_DIR}/addon"
|
|
ADDON_XML="${SRC_ADDON_DIR}/addon.xml"
|
|
|
|
if [[ ! -f "${ADDON_XML}" ]]; then
|
|
echo "Missing: ${ADDON_XML}" >&2
|
|
exit 1
|
|
fi
|
|
|
|
ADDON_ID="$(python3 - "${ADDON_XML}" <<'PY'
|
|
import sys
|
|
import xml.etree.ElementTree as ET
|
|
|
|
tree = ET.parse(sys.argv[1])
|
|
root = tree.getroot()
|
|
print(root.attrib.get("id", "plugin.unknown"))
|
|
PY
|
|
)"
|
|
|
|
ADDON_VERSION="$(python3 - "${ADDON_XML}" <<'PY'
|
|
import sys
|
|
import xml.etree.ElementTree as ET
|
|
|
|
tree = ET.parse(sys.argv[1])
|
|
root = tree.getroot()
|
|
print(root.attrib.get("version", "0.0.0"))
|
|
PY
|
|
)"
|
|
|
|
ZIP_NAME="${ADDON_ID}-${ADDON_VERSION}.zip"
|
|
ZIP_PATH="${INSTALL_DIR}/${ZIP_NAME}"
|
|
|
|
ADDON_DIR="$("${ROOT_DIR}/scripts/build_install_addon.sh" >/dev/null; echo "${INSTALL_DIR}/${ADDON_ID}")"
|
|
|
|
rm -f "${ZIP_PATH}"
|
|
(cd "${INSTALL_DIR}" && zip -r "${ZIP_NAME}" "$(basename "${ADDON_DIR}")" >/dev/null)
|
|
|
|
echo "${ZIP_PATH}"
|