Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segment Provider #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<Version>1.0.0.0</Version>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<FileVersion>1.0.0.0</FileVersion>
<Version>1.0.2.0</Version>
<AssemblyVersion>1.0.2.0</AssemblyVersion>
<FileVersion>1.0.2.0</FileVersion>
</PropertyGroup>
</Project>
18 changes: 18 additions & 0 deletions Jellyfin.Plugin.MediaSegmentsApi/PluginServiceRegistrator.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using Jellyfin.Plugin.MediaSegmentsApi.Providers;
using MediaBrowser.Controller;
using MediaBrowser.Controller.Plugins;
using Microsoft.Extensions.DependencyInjection;

namespace Jellyfin.Plugin.MediaSegmentsApi;

/// <summary>
/// Register MediaSegmentsApi services.
/// </summary>
public class PluginServiceRegistrator : IPluginServiceRegistrator
{
/// <inheritdoc />
public void RegisterServices(IServiceCollection serviceCollection, IServerApplicationHost applicationHost)
{
serviceCollection.AddSingleton<IMediaSegmentProvider, SegmentProvider>();
}
}
24 changes: 24 additions & 0 deletions Jellyfin.Plugin.MediaSegmentsApi/Providers/SegmentProvider.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Controller;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Model;
using MediaBrowser.Model.MediaSegments;

namespace Jellyfin.Plugin.MediaSegmentsApi.Providers;

/// <summary>
/// MediaSegmentsApi media segment provider.
/// </summary>
public class SegmentProvider : IMediaSegmentProvider
{
/// <inheritdoc/>
public string Name => Plugin.Instance!.Name;

/// <inheritdoc/>
public Task<IReadOnlyList<MediaSegmentDto>> GetMediaSegments(MediaSegmentGenerationRequest request, CancellationToken cancellationToken) => Task.FromResult<IReadOnlyList<MediaSegmentDto>>([]);

/// <inheritdoc/>
public ValueTask<bool> Supports(BaseItem item) => ValueTask.FromResult(false);
}
4 changes: 2 additions & 2 deletions build.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
name: "MediaSegments API"
guid: "6f0aaab5-e251-4a6d-b8d5-bc8c65222051"
version: "1.0.0.0"
version: "1.0.2.0"
targetAbi: "10.10.2.0"
framework: "net8.0"
overview: "Create and delete Media Segments"
description: >
Provide an extended HTTP API to create and delete MediaSegments
category: "General"
owner: "Endrl"
owner: "intro-skipper"
artifacts:
- "Jellyfin.Plugin.MediaSegmentsApi.dll"
changelog: >
Expand Down
Loading