Skip to content

Commit

Permalink
Merge pull request #52 from iloveicedgreentea/develop
Browse files Browse the repository at this point in the history
Fix missing volume
  • Loading branch information
iloveicedgreentea authored Feb 6, 2024
2 parents db2ee87 + 133fd07 commit 46b6e6b
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 48 deletions.
46 changes: 5 additions & 41 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
name: Docker

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

on:
push:
branches: ["master"]
# Publish semver tags as releases.
tags: ["v*.*.*"]
tags: ['v*.*.*'] # Triggers on tag following semantic versioning
pull_request:
branches: ["master", "develop", "clip_support"]
branches: ['master', 'develop'] # Triggers on PR to these branches

env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}

jobs:
Expand All @@ -25,59 +16,32 @@ jobs:
permissions:
contents: read
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
# Workaround: https://github.com/docker/build-push-action/issues/461

- name: Setup Docker buildx
uses: docker/setup-buildx-action@v3.0.0

# TODO: run tests

# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: ${{ github.ref == 'refs/heads/master' || github.event_name == 'pull_request' && github.head_ref == 'develop' }}
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
uses: docker/login-action@v3.0.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5.5.1
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v5.0.0
with:
context: .
# platforms: linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7
push: ${{ github.ref == 'refs/heads/master' || github.event_name == 'pull_request' && github.head_ref == 'develop' }}
push: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
tags: ${{ steps.meta.outputs.tags }}
# cache-from: type=gha
# cache-to: type=gha,mode=max

# # Sign the resulting Docker image digest except on PRs.
# # This will only write to the public Rekor transparency log when the Docker
# # repository is public to avoid leaking data. If you would like to publish
# # transparency data even for private images, pass --force to cosign below.
# # https://github.com/sigstore/cosign
# - name: Sign the published Docker image
# if: ${{ github.event_name != 'pull_request' }}
# env:
# COSIGN_EXPERIMENTAL: "true"
# # This step uses the identity token to provision an ephemeral certificate
# # against the sigstore community Fulcio instance.
# run: echo "${{ steps.meta.outputs.tags }}" | xargs -I {} cosign sign {}@${{ steps.build-and-push.outputs.digest }}
3 changes: 2 additions & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,5 @@ Modify UUID filter to accept comma for multiple
* fix cache on resume
* various speedups
* remove listen port config
* improve search by using tmdb
* improve search by using tmdb
* add author name to mqtt topic and logs
4 changes: 2 additions & 2 deletions internal/ezbeq/ezbeq.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ func (c *BeqClient) LoadBeqProfile(m *models.SearchRequest) error {
}

if m.DryrunMode {
return fmt.Errorf("BEQ Dry run msg - Would load title %s -- codec %s -- edition: %s, ezbeq entry ID %s", catalog.SortTitle, m.Codec, catalog.Edition, m.EntryID)
return fmt.Errorf("BEQ Dry run msg - Would load title %s -- codec %s -- edition: %s, ezbeq entry ID %s - author %s", catalog.Title, m.Codec, catalog.Edition, m.EntryID, catalog.Author)
}

// build payload
Expand Down Expand Up @@ -392,7 +392,7 @@ func (c *BeqClient) LoadBeqProfile(m *models.SearchRequest) error {
}
}

return mqtt.PublishWrapper(config.GetString("mqtt.topicBeqCurrentProfile"), fmt.Sprintf("%s: Codec: %s, Author: %s", catalog.SortTitle, m.Codec, catalog.Author))
return mqtt.PublishWrapper(config.GetString("mqtt.topicBeqCurrentProfile"), fmt.Sprintf("%s: %s by %s", catalog.Title, m.Codec, catalog.Author))
}

// UnloadBeqProfile will unload all profiles from all devices
Expand Down
1 change: 1 addition & 0 deletions internal/handlers/plex_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ func interfaceRemote(cmd string, c *homeassistant.HomeAssistantClient) error {
// play is both the "resume" button and play
func mediaPlay(client *plex.PlexClient, beqClient *ezbeq.BeqClient, haClient *homeassistant.HomeAssistantClient, avrClient avr.AVRClient, payload models.PlexWebhookPayload, m *models.SearchRequest, useAvrCodec bool, data models.MediaContainer, skipActions *bool, wg *sync.WaitGroup) {
go common.ChangeLight("off")
go common.ChangeMasterVolume(m.MediaType)
var err error
// slower but more accurate
// TODO: abstract library this for any AVR
Expand Down
2 changes: 2 additions & 0 deletions internal/jellyfin/jellyfin.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ func (c *JellyfinClient) GetPlexMovieDb(payload interface{}) string {

// TODO: finish
func (c *JellyfinClient) GetAudioCodec(payload interface{}) (string, error) {
// codec, title, profile, err := c.GetCodec(payload.(models.JellyfinMetadata))
// TODO: parse the response and map this to the beq codec standards
return "", nil
}
// generic function to make a request
Expand Down
27 changes: 23 additions & 4 deletions test.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,33 @@
#!/bin/bash
#!/usr/bin/env bash

unset LOG_LEVEL

set -euo pipefail
readarray -t dirs < <(find . -type d -not -path "./.git*")
set -uo pipefail

while IFS=\= read -r dir; do
dirs+=("$dir")
done < <(find . -type d -not -path "./.git*")

# readarray -t dirs < <(find . -type d -not -path "./.git*")

run_tests() {
local dir=$1
echo "Testing $dir"
(cd "$dir" && go test -cover -coverprofile=coverage.out)
(
cd "$dir" || exit 1
out=$(go test -cover -coverprofile=coverage.out 2>&1)
code=$?
if [ $code -ne 0 ]; then
if echo "$out"| grep -q "files in"; then
code=0
else
echo "Error testing $dir"
echo "$out"
exit $code
fi
fi

)
}


Expand Down

0 comments on commit 46b6e6b

Please sign in to comment.