Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c1b5dea569 | ||
|
|
2879ebf4df | ||
|
|
b0cdcda900 | ||
|
|
5fadf5a9a7 | ||
|
|
a6ae4994e9 | ||
|
|
12af9bddb1 | ||
|
|
92a840cf42 | ||
|
|
9210532cf1 | ||
|
|
66d5faead2 | ||
|
|
65c7a16cee |
@@ -15,36 +15,48 @@ on:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: linux/amd64
|
||||
container:
|
||||
image: gitea.tourolle.paris/dtourolle/srfplay-builder:latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
path: build-${{ github.run_id }}
|
||||
|
||||
- name: Restore dependencies
|
||||
working-directory: build-${{ github.run_id }}
|
||||
run: dotnet restore Jellyfin.Plugin.SRFPlay.sln
|
||||
|
||||
- name: Build solution
|
||||
run: dotnet build Jellyfin.Plugin.SRFPlay.sln --configuration Release --no-restore --no-self-contained
|
||||
working-directory: build-${{ github.run_id }}
|
||||
run: dotnet build Jellyfin.Plugin.SRFPlay.sln --configuration Release --no-restore --no-self-contained /m:1
|
||||
|
||||
- name: Run tests
|
||||
working-directory: build-${{ github.run_id }}
|
||||
run: dotnet test Jellyfin.Plugin.SRFPlay.sln --no-build --configuration Release --verbosity normal
|
||||
|
||||
- name: Build Jellyfin Plugin
|
||||
id: jprm
|
||||
working-directory: build-${{ github.run_id }}
|
||||
run: |
|
||||
mkdir -p artifacts
|
||||
jprm --verbosity=debug plugin build .
|
||||
ARTIFACT=$(find . -name "*.zip" -type f -print -quit)
|
||||
echo "artifact=${ARTIFACT}" >> $GITHUB_OUTPUT
|
||||
echo "Found artifact: ${ARTIFACT}"
|
||||
ARTIFACT=$(find . -name "*.zip" -type f -print -quit | sed 's|^\./||')
|
||||
LATEST="artifacts/srfplay_latest.zip"
|
||||
cp "${ARTIFACT}" "${LATEST}"
|
||||
echo "artifact=${LATEST}" >> $GITHUB_OUTPUT
|
||||
echo "Found artifact: ${ARTIFACT} -> ${LATEST}"
|
||||
|
||||
- name: Upload build artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: jellyfin-srfplay-plugin
|
||||
path: ${{ steps.jprm.outputs.artifact }}
|
||||
path: build-${{ github.run_id }}/${{ steps.jprm.outputs.artifact }}
|
||||
retention-days: 30
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Cleanup
|
||||
if: always()
|
||||
run: rm -rf build-${{ github.run_id }}
|
||||
|
||||
@@ -13,13 +13,15 @@ on:
|
||||
|
||||
jobs:
|
||||
build-and-release:
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: linux/amd64
|
||||
container:
|
||||
image: gitea.tourolle.paris/dtourolle/srfplay-builder:latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
path: release-${{ github.run_id }}
|
||||
|
||||
- name: Get version
|
||||
id: get_version
|
||||
@@ -34,26 +36,31 @@ jobs:
|
||||
echo "Building version: ${VERSION}"
|
||||
|
||||
- name: Update build.yaml with version
|
||||
working-directory: release-${{ github.run_id }}
|
||||
run: |
|
||||
VERSION="${{ steps.get_version.outputs.version_number }}"
|
||||
sed -i "s/^version:.*/version: \"${VERSION}\"/" build.yaml
|
||||
cat build.yaml
|
||||
|
||||
- name: Restore dependencies
|
||||
working-directory: release-${{ github.run_id }}
|
||||
run: dotnet restore Jellyfin.Plugin.SRFPlay.sln
|
||||
|
||||
- name: Build solution
|
||||
run: dotnet build Jellyfin.Plugin.SRFPlay.sln --configuration Release --no-restore --no-self-contained
|
||||
working-directory: release-${{ github.run_id }}
|
||||
run: dotnet build Jellyfin.Plugin.SRFPlay.sln --configuration Release --no-restore --no-self-contained /m:1
|
||||
|
||||
- name: Run tests
|
||||
working-directory: release-${{ github.run_id }}
|
||||
run: dotnet test Jellyfin.Plugin.SRFPlay.sln --no-build --configuration Release --verbosity normal
|
||||
|
||||
- name: Build Jellyfin Plugin
|
||||
id: jprm
|
||||
working-directory: release-${{ github.run_id }}
|
||||
run: |
|
||||
mkdir -p artifacts
|
||||
jprm --verbosity=debug plugin build ./
|
||||
ARTIFACT=$(find . -name "*.zip" -type f -print -quit)
|
||||
ARTIFACT=$(find . -name "*.zip" -type f -print -quit | sed 's|^\./||')
|
||||
ARTIFACT_NAME=$(basename "${ARTIFACT}")
|
||||
echo "artifact=${ARTIFACT}" >> $GITHUB_OUTPUT
|
||||
echo "artifact_name=${ARTIFACT_NAME}" >> $GITHUB_OUTPUT
|
||||
@@ -61,12 +68,14 @@ jobs:
|
||||
|
||||
- name: Calculate checksum
|
||||
id: checksum
|
||||
working-directory: release-${{ github.run_id }}
|
||||
run: |
|
||||
CHECKSUM=$(md5sum "${{ steps.jprm.outputs.artifact }}" | awk '{print $1}')
|
||||
echo "checksum=${CHECKSUM}" >> $GITHUB_OUTPUT
|
||||
echo "Checksum: ${CHECKSUM}"
|
||||
|
||||
- name: Create Release
|
||||
working-directory: release-${{ github.run_id }}
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
@@ -75,22 +84,13 @@ jobs:
|
||||
REPO_NAME="${{ github.event.repository.name }}"
|
||||
GITEA_URL="${{ github.server_url }}"
|
||||
|
||||
# Prepare release body
|
||||
RELEASE_BODY="SRFPlay Jellyfin Plugin ${{ steps.get_version.outputs.version }}\n\nSee attached files for plugin installation."
|
||||
RELEASE_BODY_JSON=$(echo -n "${RELEASE_BODY}" | jq -Rs .)
|
||||
|
||||
# Create release using Gitea API
|
||||
VERSION="${{ steps.get_version.outputs.version }}"
|
||||
RESPONSE=$(curl -s -w "\n%{http_code}" -X POST \
|
||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
"${GITEA_URL}/api/v1/repos/${REPO_OWNER}/${REPO_NAME}/releases" \
|
||||
-d "{
|
||||
\"tag_name\": \"${{ steps.get_version.outputs.version }}\",
|
||||
\"name\": \"Release ${{ steps.get_version.outputs.version }}\",
|
||||
\"body\": ${RELEASE_BODY_JSON},
|
||||
\"draft\": false,
|
||||
\"prerelease\": false
|
||||
}")
|
||||
-d "$(jq -n --arg tag "$VERSION" --arg name "Release $VERSION" --arg body "SRFPlay Jellyfin Plugin. See attached files for plugin installation." '{tag_name: $tag, name: $name, body: $body, draft: false, prerelease: false}')")
|
||||
|
||||
HTTP_CODE=$(echo "$RESPONSE" | tail -n1)
|
||||
BODY=$(echo "$RESPONSE" | sed '$d')
|
||||
@@ -124,6 +124,7 @@ jobs:
|
||||
echo "View at: ${GITEA_URL}/${REPO_OWNER}/${REPO_NAME}/releases/tag/${{ steps.get_version.outputs.version }}"
|
||||
|
||||
- name: Update manifest.json
|
||||
working-directory: release-${{ github.run_id }}
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
@@ -157,3 +158,7 @@ jobs:
|
||||
git add manifest.json
|
||||
git commit -m "Update manifest.json for version ${VERSION}"
|
||||
git push origin master
|
||||
|
||||
- name: Cleanup
|
||||
if: always()
|
||||
run: rm -rf release-${{ github.run_id }}
|
||||
|
||||
@@ -17,21 +17,26 @@ on:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: linux/amd64
|
||||
container:
|
||||
image: gitea.tourolle.paris/dtourolle/srfplay-builder:latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
path: test-${{ github.run_id }}
|
||||
|
||||
- name: Restore dependencies
|
||||
working-directory: test-${{ github.run_id }}
|
||||
run: dotnet restore Jellyfin.Plugin.SRFPlay.sln
|
||||
|
||||
- name: Build solution
|
||||
run: dotnet build Jellyfin.Plugin.SRFPlay.sln --configuration Debug --no-restore --no-self-contained
|
||||
working-directory: test-${{ github.run_id }}
|
||||
run: dotnet build Jellyfin.Plugin.SRFPlay.sln --configuration Debug --no-restore --no-self-contained /m:1
|
||||
|
||||
- name: Run tests
|
||||
working-directory: test-${{ github.run_id }}
|
||||
run: dotnet test Jellyfin.Plugin.SRFPlay.sln --no-build --configuration Debug --verbosity normal --logger "trx;LogFileName=test-results.trx"
|
||||
|
||||
- name: Upload test results
|
||||
@@ -39,5 +44,9 @@ jobs:
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: test-results
|
||||
path: '**/test-results.trx'
|
||||
path: test-${{ github.run_id }}/**/test-results.trx
|
||||
retention-days: 7
|
||||
|
||||
- name: Cleanup
|
||||
if: always()
|
||||
run: rm -rf test-${{ github.run_id }}
|
||||
|
||||
@@ -10,6 +10,8 @@ RUN apt-get update && apt-get install -y \
|
||||
python3-pip \
|
||||
git \
|
||||
jq \
|
||||
nodejs \
|
||||
npm \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN pip install --break-system-packages jprm
|
||||
|
||||
@@ -292,9 +292,23 @@ public class StreamProxyController : ControllerBase
|
||||
_logger.LogDebug("Streamed segment {SegmentPath} ({ContentType})", segmentPath, contentType);
|
||||
return new EmptyResult();
|
||||
}
|
||||
catch (OperationCanceledException)
|
||||
{
|
||||
// Client disconnected during streaming (e.g., FFmpeg stopped, player seeked).
|
||||
// This is expected behavior, not an error.
|
||||
_logger.LogDebug("Segment streaming canceled - ItemId: {ItemId}, Path: {SegmentPath}", itemId, segmentPath);
|
||||
return new EmptyResult();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Error proxying segment - ItemId: {ItemId}, Path: {SegmentPath}", itemId, segmentPath);
|
||||
|
||||
// If we already started streaming data to the client, we can't change the status code
|
||||
if (Response.HasStarted)
|
||||
{
|
||||
return new EmptyResult();
|
||||
}
|
||||
|
||||
return StatusCode(StatusCodes.Status500InternalServerError);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,9 +120,10 @@ public class ContentExpirationService : IContentExpirationService
|
||||
|
||||
if (mediaComposition?.HasChapters != true)
|
||||
{
|
||||
// If we can't fetch the content, consider it expired
|
||||
_logger.LogWarning("Could not fetch media composition for URN: {Urn}, treating as expired", urn);
|
||||
return true;
|
||||
// Don't treat API failures as expired - the content may still be available
|
||||
// and a transient error (network issue, 403, API outage) shouldn't delete library items
|
||||
_logger.LogWarning("Could not fetch media composition for URN: {Urn}, skipping (not treating as expired)", urn);
|
||||
return false;
|
||||
}
|
||||
|
||||
var chapter = mediaComposition.ChapterList[0];
|
||||
|
||||
@@ -373,6 +373,15 @@ public class StreamProxyService : IStreamProxyService
|
||||
return refreshedUrl;
|
||||
}
|
||||
|
||||
if (streamInfo.IsLiveStream)
|
||||
{
|
||||
// For livestreams, keep the mapping and flag for re-authentication
|
||||
// rather than removing it — the next request will trigger a fresh auth
|
||||
_logger.LogWarning("Failed to refresh token for livestream {ItemId}, will re-authenticate on next request", itemId);
|
||||
streamInfo.NeedsAuthentication = true;
|
||||
return streamInfo.AuthenticatedUrl;
|
||||
}
|
||||
|
||||
_logger.LogWarning("Failed to refresh token for item {ItemId}, removing mapping", itemId);
|
||||
_streamMappings.TryRemove(itemId, out _);
|
||||
return null;
|
||||
@@ -979,8 +988,9 @@ public class StreamProxyService : IStreamProxyService
|
||||
_logger.LogDebug("Marking item {ItemId} for cleanup (old registration)", kvp.Key);
|
||||
}
|
||||
|
||||
// Remove if token has expired
|
||||
if (kvp.Value.TokenExpiresAt.HasValue && kvp.Value.TokenExpiresAt.Value <= now)
|
||||
// Remove if token has expired — but skip livestreams since their CDN tokens
|
||||
// expire every ~30s and get refreshed on-demand during playback
|
||||
if (kvp.Value.TokenExpiresAt.HasValue && kvp.Value.TokenExpiresAt.Value <= now && !kvp.Value.IsLiveStream)
|
||||
{
|
||||
shouldRemove = true;
|
||||
_logger.LogDebug("Marking item {ItemId} for cleanup (expired token)", kvp.Key);
|
||||
|
||||
@@ -8,6 +8,14 @@
|
||||
"category": "Live TV",
|
||||
"imageUrl": "https://gitea.tourolle.paris/dtourolle/jellyfin-srfPlay/raw/branch/master/assests/main%20logo.png",
|
||||
"versions": [
|
||||
{
|
||||
"version": "1.0.22",
|
||||
"changelog": "Release 1.0.22",
|
||||
"targetAbi": "10.9.0.0",
|
||||
"sourceUrl": "https://gitea.tourolle.paris/dtourolle/jellyfin-srfPlay/releases/download/v1.0.22/srfplay_1.0.22.0.zip",
|
||||
"checksum": "08177ed8edb4b4cf2441bc808b9860bb",
|
||||
"timestamp": "2026-02-28T11:36:30Z"
|
||||
},
|
||||
{
|
||||
"version": "1.0.16",
|
||||
"changelog": "Release 1.0.16",
|
||||
|
||||
Reference in New Issue
Block a user