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

Feature: Media Segments #10530

Closed
wants to merge 44 commits into from
Closed

Feature: Media Segments #10530

wants to merge 44 commits into from

Conversation

endrl
Copy link

@endrl endrl commented Nov 4, 2023

I want to propose my take for the "Intro Outro" feature. This is considered a basic implementation that can be advanced.

Meta Ref: jellyfin/jellyfin-meta#30

Thoughts

  • Chapter integration
    • They are still in the wrong db. Is there a code example how i can migrate them to ef core?
    • How should the final "MediaSegment" look like?
  • MediaSegmentAction
    • Usually it will be set to "Auto" where user settings will eval the final action.
    • A MediaSegment provider (plugin) can also change this through the config page. This might be interesting when you use youtube or other video sources where the default behaviour for "all" content is not desired.
    • As the REST api allow edits you can manage this also on your own for each single entry (media management enthusiasts?)
  • ItemId
    • Is also missing in db, migration required

Testing

To explore the ecosystem i created some implementations. A docker compose file is available.

Related projects

Happy testing! Feedback welcome.

Copy link

github-actions bot commented Nov 4, 2023

Changes in OpenAPI specification found. Expand to see details.

What's New


GET /MediaSegments/{itemId}

Get all media segments.

POST /MediaSegments/{itemId}

Create or update multiple media segments. All fields are updateable except Id.

DELETE /MediaSegments/{itemId}

Delete media segments.

What's Changed


GET /Artists/{name}
Return Type:

Changed response : 200 OK

Artist returned.

  • Changed content type : application/json

    • Added property MediaSegments (array)

      Gets or sets the media segments data.

      Items (object):
      > A moment in time of a media stream (ItemId+StreamIndex) with Type and possible Action applicable between StartTicks/Endticks.

      • Property Id (string)

        Gets or sets the unique segment id. Database generated. Required to update an entry.

      • Property StartTicks (integer)

        Gets or sets the start position in Ticks.

      • Property EndTicks (integer)

        Gets or sets the end position in Ticks.

      • Property Type (string)

        Gets or sets the Type.

        Enum values:

        • Intro

        • Outro

        • Recap

        • Preview

        • Commercial

        • Annotation
          One of:

          Enum values:

          • Intro
          • Outro
          • Recap
          • Preview
          • Commercial
          • Annotation
      • Property ItemId (string)

        Gets or sets the associated ItemId.

      • Property StreamIndex (integer)

        Gets or sets the associated MediaStreamIndex.

      • Property Action (string)

        Gets or sets the action.

        Enum values:

        • None

        • Skip

        • PromptToSkip

        • Mute
          One of:

          Enum values:

          • None
          • Skip
          • PromptToSkip
          • Mute
      • Property Comment (string)

        Gets or sets a comment. The user provided value to be displayed when the Jellyfin.Data.Entities.MediaSegment.MediaSegment.Type is a Jellyfin.Data.Enums.MediaSegmentType.MediaSegmentType.Annotation.

  • Changed content type : application/json; profile="CamelCase"

    • Added property MediaSegments (array)

      Gets or sets the media segments data.

  • Changed content type : application/json; profile="PascalCase"

    • Added property MediaSegments (array)

      Gets or sets the media segments data.

GET /Genres/{genreName}
Return Type:

Changed response : 200 OK

Genres returned.

  • Changed content type : application/json

    • Added property MediaSegments (array)

      Gets or sets the media segments data.

  • Changed content type : application/json; profile="CamelCase"

    • Added property MediaSegments (array)

      Gets or sets the media segments data.

  • Changed content type : application/json; profile="PascalCase"

    • Added property MediaSegments (array)

      Gets or sets the media segments data.

GET /Items/{itemId}
Return Type:

Changed response : 200 OK

Item returned.

  • Changed content type : application/json

    • Added property MediaSegments (array)

      Gets or sets the media segments data.

  • Changed content type : application/json; profile="CamelCase"

    • Added property MediaSegments (array)

      Gets or sets the media segments data.

  • Changed content type : application/json; profile="PascalCase"

    • Added property MediaSegments (array)

      Gets or sets the media segments data.

POST /Items/{itemId}
Request:

Changed content type : application/json

Updated BaseItemDto :

  • Added property MediaSegments (array)

    Gets or sets the media segments data.

Changed content type : text/json

Updated BaseItemDto :

  • Added property MediaSegments (array)

    Gets or sets the media segments data.

Changed content type : application/*+json

Updated BaseItemDto :

  • Added property MediaSegments (array)

    Gets or sets the media segments data.

GET /Items/{itemId}/Ancestors
Return Type:

Changed response : 200 OK

Item parents returned.

  • Changed content type : application/json

    Changed items (object):
    > This is strictly used as a data transfer object from the api layer.
    > This holds information about a BaseItem in a format that is convenient for the client.

    • Added property MediaSegments (array)

      Gets or sets the media segments data.

  • Changed content type : application/json; profile="CamelCase"

    Changed items (object):
    > This is strictly used as a data transfer object from the api layer.
    > This holds information about a BaseItem in a format that is convenient for the client.

    • Added property MediaSegments (array)

      Gets or sets the media segments data.

  • Changed content type : application/json; profile="PascalCase"

    Changed items (object):
    > This is strictly used as a data transfer object from the api layer.
    > This holds information about a BaseItem in a format that is convenient for the client.

    • Added property MediaSegments (array)

      Gets or sets the media segments data.

GET /LiveTv/Channels/{channelId}
Return Type:

Changed response : 200 OK

Live tv channel returned.

  • Changed content type : application/json

    • Added property MediaSegments (array)

      Gets or sets the media segments data.

  • Changed content type : application/json; profile="CamelCase"

    • Added property MediaSegments (array)

      Gets or sets the media segments data.

  • Changed content type : application/json; profile="PascalCase"

    • Added property MediaSegments (array)

      Gets or sets the media segments data.

GET /LiveTv/Programs/{programId}
Return Type:

Changed response : 200 OK

Program returned.

  • Changed content type : application/json

    • Added property MediaSegments (array)

      Gets or sets the media segments data.

  • Changed content type : application/json; profile="CamelCase"

    • Added property MediaSegments (array)

      Gets or sets the media segments data.

  • Changed content type : application/json; profile="PascalCase"

    • Added property MediaSegments (array)

      Gets or sets the media segments data.

GET /LiveTv/Recordings/{recordingId}
Return Type:

Changed response : 200 OK

Recording returned.

  • Changed content type : application/json

    • Added property MediaSegments (array)

      Gets or sets the media segments data.

  • Changed content type : application/json; profile="CamelCase"

    • Added property MediaSegments (array)

      Gets or sets the media segments data.

  • Changed content type : application/json; profile="PascalCase"

    • Added property MediaSegments (array)

      Gets or sets the media segments data.

GET /MusicGenres/{genreName}
Return Type:

Changed response : 200 OK

Success

  • Changed content type : application/json

    • Added property MediaSegments (array)

      Gets or sets the media segments data.

  • Changed content type : application/json; profile="CamelCase"

    • Added property MediaSegments (array)

      Gets or sets the media segments data.

  • Changed content type : application/json; profile="PascalCase"

    • Added property MediaSegments (array)

      Gets or sets the media segments data.

GET /Persons/{name}
Return Type:

Changed response : 200 OK

Person returned.

  • Changed content type : application/json

    • Added property MediaSegments (array)

      Gets or sets the media segments data.

  • Changed content type : application/json; profile="CamelCase"

    • Added property MediaSegments (array)

      Gets or sets the media segments data.

  • Changed content type : application/json; profile="PascalCase"

    • Added property MediaSegments (array)

      Gets or sets the media segments data.

GET /Studios/{name}
Return Type:

Changed response : 200 OK

Studio returned.

  • Changed content type : application/json

    • Added property MediaSegments (array)

      Gets or sets the media segments data.

  • Changed content type : application/json; profile="CamelCase"

    • Added property MediaSegments (array)

      Gets or sets the media segments data.

  • Changed content type : application/json; profile="PascalCase"

    • Added property MediaSegments (array)

      Gets or sets the media segments data.

POST /Users/{userId}/Policy
Request:

Changed content type : application/json

Updated UserPolicy :

  • Added property EnableMediaSegmentsManagement (boolean)

    Gets or sets a value indicating whether this user can manage media segments.

Changed content type : text/json

Updated UserPolicy :

  • Added property EnableMediaSegmentsManagement (boolean)

    Gets or sets a value indicating whether this user can manage media segments.

Changed content type : application/*+json

Updated UserPolicy :

  • Added property EnableMediaSegmentsManagement (boolean)

    Gets or sets a value indicating whether this user can manage media segments.

GET /Items/{itemId}/LocalTrailers
Return Type:

Changed response : 200 OK

An Microsoft.AspNetCore.Mvc.OkResult containing the item's local trailers.

  • Changed content type : application/json

    Changed items (object):
    > This is strictly used as a data transfer object from the api layer.
    > This holds information about a BaseItem in a format that is convenient for the client.

    • Added property MediaSegments (array)

      Gets or sets the media segments data.

  • Changed content type : application/json; profile="CamelCase"

    Changed items (object):
    > This is strictly used as a data transfer object from the api layer.
    > This holds information about a BaseItem in a format that is convenient for the client.

    • Added property MediaSegments (array)

      Gets or sets the media segments data.

  • Changed content type : application/json; profile="PascalCase"

    Changed items (object):
    > This is strictly used as a data transfer object from the api layer.
    > This holds information about a BaseItem in a format that is convenient for the client.

    • Added property MediaSegments (array)

      Gets or sets the media segments data.

GET /Items/{itemId}/SpecialFeatures
Return Type:

Changed response : 200 OK

Special features returned.

  • Changed content type : application/json

    Changed items (object):
    > This is strictly used as a data transfer object from the api layer.
    > This holds information about a BaseItem in a format that is convenient for the client.

    • Added property MediaSegments (array)

      Gets or sets the media segments data.

  • Changed content type : application/json; profile="CamelCase"

    Changed items (object):
    > This is strictly used as a data transfer object from the api layer.
    > This holds information about a BaseItem in a format that is convenient for the client.

    • Added property MediaSegments (array)

      Gets or sets the media segments data.

  • Changed content type : application/json; profile="PascalCase"

    Changed items (object):
    > This is strictly used as a data transfer object from the api layer.
    > This holds information about a BaseItem in a format that is convenient for the client.

    • Added property MediaSegments (array)

      Gets or sets the media segments data.

GET /Items/Latest
Parameters:

Changed: fields in query

Optional. Specify additional fields of information to return in the output.

Return Type:

Changed response : 200 OK

Latest media returned.

  • Changed content type : application/json

    Changed items (object):
    > This is strictly used as a data transfer object from the api layer.
    > This holds information about a BaseItem in a format that is convenient for the client.

    • Added property MediaSegments (array)

      Gets or sets the media segments data.

  • Changed content type : application/json; profile="CamelCase"

    Changed items (object):
    > This is strictly used as a data transfer object from the api layer.
    > This holds information about a BaseItem in a format that is convenient for the client.

    • Added property MediaSegments (array)

      Gets or sets the media segments data.

  • Changed content type : application/json; profile="PascalCase"

    Changed items (object):
    > This is strictly used as a data transfer object from the api layer.
    > This holds information about a BaseItem in a format that is convenient for the client.

    • Added property MediaSegments (array)

      Gets or sets the media segments data.

GET /Items/Root
Return Type:

Changed response : 200 OK

Root folder returned.

  • Changed content type : application/json

    • Added property MediaSegments (array)

      Gets or sets the media segments data.

  • Changed content type : application/json; profile="CamelCase"

    • Added property MediaSegments (array)

      Gets or sets the media segments data.

  • Changed content type : application/json; profile="PascalCase"

    • Added property MediaSegments (array)

      Gets or sets the media segments data.

GET /Years/{year}
Return Type:

Changed response : 200 OK

Year returned.

  • Changed content type : application/json

    • Added property MediaSegments (array)

      Gets or sets the media segments data.

  • Changed content type : application/json; profile="CamelCase"

    • Added property MediaSegments (array)

      Gets or sets the media segments data.

  • Changed content type : application/json; profile="PascalCase"

    • Added property MediaSegments (array)

      Gets or sets the media segments data.

GET /Artists
Parameters:

Changed: fields in query

Optional. Specify additional fields of information to return in the output.

Return Type:

Changed response : 200 OK

Artists returned.

  • Changed content type : application/json

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="CamelCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="PascalCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

GET /Artists/AlbumArtists
Parameters:

Changed: fields in query

Optional. Specify additional fields of information to return in the output.

Return Type:

Changed response : 200 OK

Album artists returned.

  • Changed content type : application/json

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="CamelCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="PascalCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

GET /Channels
Return Type:

Changed response : 200 OK

Channels returned.

  • Changed content type : application/json

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="CamelCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="PascalCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

GET /Channels/{channelId}/Items
Parameters:

Changed: fields in query

Optional. Specify additional fields of information to return in the output.

Return Type:

Changed response : 200 OK

Channel items returned.

  • Changed content type : application/json

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="CamelCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="PascalCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

GET /Channels/Items/Latest
Parameters:

Changed: fields in query

Optional. Specify additional fields of information to return in the output.

Return Type:

Changed response : 200 OK

Latest channel items returned.

  • Changed content type : application/json

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="CamelCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="PascalCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

GET /Genres
Parameters:

Changed: fields in query

Optional. Specify additional fields of information to return in the output.

Return Type:

Changed response : 200 OK

Genres returned.

  • Changed content type : application/json

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="CamelCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="PascalCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

GET /Albums/{itemId}/InstantMix
Parameters:

Changed: fields in query

Optional. Specify additional fields of information to return in the output.

Return Type:

Changed response : 200 OK

Instant playlist returned.

  • Changed content type : application/json

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="CamelCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="PascalCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

GET /Artists/{itemId}/InstantMix
Parameters:

Changed: fields in query

Optional. Specify additional fields of information to return in the output.

Return Type:

Changed response : 200 OK

Instant playlist returned.

  • Changed content type : application/json

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="CamelCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="PascalCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

GET /Artists/InstantMix
Parameters:

Changed: fields in query

Optional. Specify additional fields of information to return in the output.

Return Type:

Changed response : 200 OK

Instant playlist returned.

  • Changed content type : application/json

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="CamelCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="PascalCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

GET /Items/{itemId}/InstantMix
Parameters:

Changed: fields in query

Optional. Specify additional fields of information to return in the output.

Return Type:

Changed response : 200 OK

Instant playlist returned.

  • Changed content type : application/json

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="CamelCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="PascalCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

GET /MusicGenres/{name}/InstantMix
Parameters:

Changed: fields in query

Optional. Specify additional fields of information to return in the output.

Return Type:

Changed response : 200 OK

Instant playlist returned.

  • Changed content type : application/json

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="CamelCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="PascalCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

GET /MusicGenres/InstantMix
Parameters:

Changed: fields in query

Optional. Specify additional fields of information to return in the output.

Return Type:

Changed response : 200 OK

Instant playlist returned.

  • Changed content type : application/json

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="CamelCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="PascalCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

GET /Playlists/{itemId}/InstantMix
Parameters:

Changed: fields in query

Optional. Specify additional fields of information to return in the output.

Return Type:

Changed response : 200 OK

Instant playlist returned.

  • Changed content type : application/json

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="CamelCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="PascalCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

GET /Songs/{itemId}/InstantMix
Parameters:

Changed: fields in query

Optional. Specify additional fields of information to return in the output.

Return Type:

Changed response : 200 OK

Instant playlist returned.

  • Changed content type : application/json

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="CamelCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="PascalCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

GET /Items
Parameters:

Changed: fields in query

Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines.

Return Type:

Changed response : 200 OK

Success

  • Changed content type : application/json

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="CamelCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="PascalCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

GET /UserItems/Resume
Parameters:

Changed: fields in query

Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines.

Return Type:

Changed response : 200 OK

Items returned.

  • Changed content type : application/json

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="CamelCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="PascalCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

GET /Albums/{itemId}/Similar
Parameters:

Changed: fields in query

Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.

Return Type:

Changed response : 200 OK

Similar items returned.

  • Changed content type : application/json

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="CamelCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="PascalCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

GET /Artists/{itemId}/Similar
Parameters:

Changed: fields in query

Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.

Return Type:

Changed response : 200 OK

Similar items returned.

  • Changed content type : application/json

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="CamelCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="PascalCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

GET /Items/{itemId}/CriticReviews
Return Type:

Changed response : 200 OK

Critic reviews returned.

  • Changed content type : application/json

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="CamelCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="PascalCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

GET /Items/{itemId}/Similar
Parameters:

Changed: fields in query

Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.

Return Type:

Changed response : 200 OK

Similar items returned.

  • Changed content type : application/json

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="CamelCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="PascalCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

GET /Items/{itemId}/ThemeSongs
Return Type:

Changed response : 200 OK

Theme songs returned.

  • Changed content type : application/json

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="CamelCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="PascalCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

GET /Items/{itemId}/ThemeVideos
Return Type:

Changed response : 200 OK

Theme videos returned.

  • Changed content type : application/json

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="CamelCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="PascalCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

GET /Library/MediaFolders
Return Type:

Changed response : 200 OK

Media folders returned.

  • Changed content type : application/json

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="CamelCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="PascalCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

GET /Movies/{itemId}/Similar
Parameters:

Changed: fields in query

Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.

Return Type:

Changed response : 200 OK

Similar items returned.

  • Changed content type : application/json

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="CamelCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="PascalCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

GET /Shows/{itemId}/Similar
Parameters:

Changed: fields in query

Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.

Return Type:

Changed response : 200 OK

Similar items returned.

  • Changed content type : application/json

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="CamelCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="PascalCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

GET /Trailers/{itemId}/Similar
Parameters:

Changed: fields in query

Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.

Return Type:

Changed response : 200 OK

Similar items returned.

  • Changed content type : application/json

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="CamelCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="PascalCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

GET /LiveTv/Channels
Parameters:

Changed: fields in query

Optional. Specify additional fields of information to return in the output.

Return Type:

Changed response : 200 OK

Available live tv channels returned.

  • Changed content type : application/json

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="CamelCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="PascalCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

GET /LiveTv/Programs
Parameters:

Changed: fields in query

Optional. Specify additional fields of information to return in the output.

Return Type:

Changed response : 200 OK

Live tv epgs returned.

  • Changed content type : application/json

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="CamelCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="PascalCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

POST /LiveTv/Programs
Request:

Changed content type : application/json

Updated GetProgramsDto :

  • Changed property Fields (array)

    Gets or sets specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines.
    Optional.

    Changed items (string):
    > Used to control the data that gets attached to DtoBaseItems.

    Added enum value:

    • MediaSegments
      Changed content type : text/json

Updated GetProgramsDto :

  • Changed property Fields (array)

    Gets or sets specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines.
    Optional.

    Changed items (string):
    > Used to control the data that gets attached to DtoBaseItems.

    Added enum value:

    • MediaSegments
      Changed content type : application/*+json

Updated GetProgramsDto :

  • Changed property Fields (array)

    Gets or sets specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines.
    Optional.

    Changed items (string):
    > Used to control the data that gets attached to DtoBaseItems.

    Added enum value:

    • MediaSegments
Return Type:

Changed response : 200 OK

Live tv epgs returned.

  • Changed content type : application/json

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="CamelCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="PascalCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

GET /LiveTv/Programs/Recommended
Parameters:

Changed: fields in query

Optional. Specify additional fields of information to return in the output.

Return Type:

Changed response : 200 OK

Recommended epgs returned.

  • Changed content type : application/json

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type : application/json; profile="CamelCase"

    • Changed property Items (array)

      Gets or sets the items.

      Changed items (object):
      > This is strictly used as a data transfer object from the api layer.
      > This holds information about a BaseItem in a format that is convenient for the client.

      • Added property MediaSegments (array)

        Gets or sets the media segments data.

  • Changed content type ...[Comment body truncated]

Copy link
Member

@nielsvanvelzen nielsvanvelzen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome to see an implementation of our long discussed segment API! I've looked into your current implementation comparing it with the meta discussion (which I found some things I disagree with as well) and analyzed it from a client developer's perspective (as I maintain the Android apps). It's essential to get the HTTP API right from the start to avoid breaking changes in future releases. Here is a list of my initial thoughts and suggestions:

Timing is not using ticks

All timings in the API use ticks. While I still think this is stupid we should also keep everything consistent and thus use ticks for MediaSegments as well.

Segments should be per source/stream

A single BaseItem can have multiple MediaSources with various MediaStreams. When playing a video, we typically have one video stream, one audio stream and one subtitle stream active. These streams can all originate from the same media source or from different ones. If I have one source that doesn't contain advertisements it will have need segments returned. The API needs to be changed to return all the segments for all streams, not for the item. The client can then use only the segments from active streams.

Integration with existing APIs

The current implementation ads the "MediaSegmentApi" that can be used to list/get/update/delete segments. While this is nice to have we must also return segments with their respective items. When (video/audio) playback starts we already have a lot of API requests which is slow and inefficient (lots of duplicate database querying etc.). We should reduce this amount, not increase it. Adding a "segments" property to MediaStream should be fine for this.

Media segment actions

I'm not sure if I like this. Different users will want different actions to happen. For instance, user A might want to see all intros/credits but user B wants to skip them and user C wants to mute only the credits. The current design does not account for that. It might be better to drop the actions and add some preferences that can vary per user.

Documentation

The DTO documentation is lacking. "Class MediaSegment." is not descriptive enough. If we want all official and unofficial clients to implement the segment API we should make sure it's behavior and usage is documented first. Fortunately some of the properties have better documentation so this should be a relatively easy change.

SyncPlay

How is this going to work with SyncPlay? I feel like we need to give this some special attention because SyncPlay is known to break a lot when playback stuff changes.

Chapters

One thing we discussed was to merge chapters and the segment proposals to make it easier to work with both. This is currently not the case. But if you think about it a chapter is basically a segment with no end (or we could just calculate the end based on the video duration/next chapter start) and some additional metadata (name/image).

@barronpm
Copy link
Member

barronpm commented Nov 9, 2023

Media segment actions

I'm not sure if I like this. Different users will want different actions to happen. For instance, user A might want to see all
intros/credits but user B wants to skip them and user C wants to mute only the credits. The current design does not account for that. It might be better to drop the actions and add some preferences that can vary per user.

I'm not sure I agree with this. While I do see the use-case for per-user configuration, adding any per-user configuration, especially as complex as this, is non-trivial, and our per-user configuration is already huge. I may be wrong, but I imagine the vast majority of the use of this feature will be for prompting to skip intros/credits.

IMO, it's best to keep it server-wide for now, since we can always re-visit it if there is a demand for it to be user-configurable.

@endrl
Copy link
Author

endrl commented Nov 11, 2023

Thank you for your fast response.

Timing is not using ticks

Moved to ticks

Segments should be per source/stream

Added a streamIndex. The itemId targets now a MediaSourceId

Integration with existing APIs

Yes, is missing and i will look into it.

Documentation

Will look into it.

SyncPlay

Never tested, as i have just a implementation for jellyfin-vue (which has no syncplay implementation i think). If two users seek at the same time what happens? I think there is nothing we can do at this point. Probably that needs to be disabled when syncplay is active.

Chapters

This is a harder one as it changes more than it looks like. I checked the source code and noticed some things.

Chapters or better said the Chapters2 table needs to be migrated to ef core. It breaks the plugin api as the used interface is IItemRepository (The interface for the old db implementation) and IChapterManager. I see this as accepted (to add more db providers in future and get rid of the raw sql file)

  • Solution 1
    • Move all methods to IChapterManager and keep the signature
    • ChapterManager uses MediaSegmentManager to adapt from and to the specific data structure
  • Solution 2
    • Remove IChapterManager and ChapterManager and refactor all references with ChapterInfo to MediaSegment, polyfill the REST api.

Action

The idea was to have access to every single segment action and influence the action also from plugin providers while creating them. By default the action is evaluated client side with possible user settings or Type defaults, but at any point you can modify it. The question is. Is that a feature or just superfluous. Checkout the test setup, the media analyzer provides the action for selection.

@endrl
Copy link
Author

endrl commented Nov 12, 2023

I had a look at the current structure. I implemented now a very simple version of the api integration.

Thoughts

  • provide segments at MediaStreams isn't possible with merged chapters. Looks probably a little bit ugly to extend the stream spec data
  • Add it to MediaSources looks better. It seems that chapters are generated for each source (file) (not implemented)
  • I set it now at the root object like trickplay
    "Name": "School of Rick",
    "Id": "cbdd1d49c4fa548247e2238855e6a759",
    "MediaSources": [
        {
            "Protocol": "File",
            "Id": "cbdd1d49c4fa548247e2238855e6a759",
            "MediaStreams": [
                {
                    "Codec": "h264",
                    "Index": 0
                },
                {
                    "Codec": "ac3",
                    "Index": 1
                },
                {
                    "Codec": "ac3",
                    "Index": 2

                }
            ],
            "Bitrate": 4570855,
        },
        {
            "Protocol": "File",
            "Id": "abcderfghijklmnopqrstuvwqyz123456789",
            "MediaStreams": [
                {
                    "Codec": "h265",
                    "Index": 0
                },
                {
                    "Codec": "ac3",
                    "Index": 1
                },
                {
                    "Codec": "ac3",
                    "Index": 2
                }
            ],
            "Bitrate": 4570855,
        }
    ],
    "SeriesName": "Rick and Morty",
    "SeasonName": "Staffel 1",
    "MediaStreams": [
        {
            "Codec": "h264",
            "Index": 0
        },
        {
            "Codec": "ac3",
            "Index": 1
        },
        {
            "Codec": "ac3",
            "Index": 2

        }
    ],
   "MediaSegments": [
       {
          "StartTicks": 0,
          "EndTicks": 1000000,
          "Type": "Intro",
          "TypeIndex": 0,
          "ItemId":  "cbdd1d49c4fa548247e2238855e6a759",
          "StreamIndex": 0
       }
    ],
    // can be also moved to a cleaner data structure like the trickplay layout
   "MediaSegments": {
    "cbdd1d49c4fa548247e2238855e6a759": [
       {
          "StartTicks": 0,
          "EndTicks": 1000000,
          "Type": "Intro",
          "StreamIndex": 0
       }
    ],
    "abcderfghijklmnopqrstuvwqyz123456789": [
       {
          "StartTicks": 0,
          "EndTicks": 1000000,
          "Type": "Intro",
          "StreamIndex": 0
       }
    ]
  },
    "Chapters": [
        {
            "StartPositionTicks": 0,
            "Name": "Kapitel 1",
            "ImageDateModified": "0001-01-01T00:00:00.0000000Z"
        },
        {
            "StartPositionTicks": 1498400000,
            "Name": "Kapitel 2",
            "ImageDateModified": "0001-01-01T00:00:00.0000000Z"
        },
        {
            "StartPositionTicks": 4953600000,
            "Name": "Kapitel 3",
            "ImageDateModified": "0001-01-01T00:00:00.0000000Z"
        },
        {
            "StartPositionTicks": 12447600000,
            "Name": "Kapitel 4",
            "ImageDateModified": "0001-01-01T00:00:00.0000000Z"
        }
    ],

@nielsvanvelzen nielsvanvelzen self-requested a review November 14, 2023 17:10
@JPVenson JPVenson added good first issue Good for newcomers backend Related to the server backend release-highlight A major new feature for the next release labels Nov 30, 2023
@thornbill
Copy link
Member

fwiw this was my start at implementing this: thornbill@6504478. I think the model captures what we had ended up agreeing to in the original discussion fairly well.

Generally I would agree with the other comments that actions should be left to clients to handle... although there are a couple segment types that blur the line somewhat. Those were mainly to support comskip and/or sponsorblock types.

I'm really glad you picked this up though because I had not made much progress with the related database changes. 🤣

@endrl
Copy link
Author

endrl commented Dec 2, 2023

@thornbill
Thank you for your feedback. I still don't like the idea to merge the Type and "some" Action because of the yt sponsored segments api. The current design is cleaner to handle the mapping between sponsored segments to a jellyfin type + action. If you provide an action (not Auto) the type is ignored and it does what it should for segment X whithout messing with the Type semantic. The segment creator can take full control of the action (just for special cases like the yt thing) so you just need to expose the SponsoredSegmentType/Action to MediaSegmentAction as a plugin config. It's not perfect especially for users as the server admin forces the action at this point, but you are still able to opt out here on client side (you do the same but without context hint (Type)).

Chapters
I found a possible issue. Chapters are assigned to a file but MediaSegments are assigned to a streamIndex. You can simply set it to stream 0 but that's a bug when you don't play that stream. Any opinions on that? It's and edge case but broken by design?

@jellyfin-bot jellyfin-bot added the merge conflict Merge conflicts should be resolved before a merge label Jan 12, 2024
@jellyfin-bot

This comment has been minimized.

@jellyfin-bot jellyfin-bot removed the merge conflict Merge conflicts should be resolved before a merge label Jan 17, 2024
@jellyfin-bot

This comment has been minimized.

@jellyfin-bot jellyfin-bot added the merge conflict Merge conflicts should be resolved before a merge label Jan 17, 2024
@nathangur
Copy link

SyncPlay

Never tested, as i have just a implementation for jellyfin-vue (which has no syncplay implementation i think). If two users seek at the same time what happens? I think there is nothing we can do at this point. Probably that needs to be disabled when syncplay is active.

I think a better approach is that the "host" of the sync play session is the only one who can adjust the media playback. Perhaps I'm ill informed but I don't see this as a major issue either way.

@CollinHerber

This comment has been minimized.

@JPVenson
Copy link
Member

Hey @endrl
As the 10.9 feature freeze comes closer and closer, do you have time, lets say within the next 2 weeks to work on this to include it into the next version?

@jellyfin-bot jellyfin-bot removed the merge conflict Merge conflicts should be resolved before a merge label Feb 20, 2024
Jellyfin.Api/Controllers/MediaSegmentController.cs Outdated Show resolved Hide resolved
Jellyfin.Api/Controllers/MediaSegmentController.cs Outdated Show resolved Hide resolved
Jellyfin.Api/Controllers/MediaSegmentController.cs Outdated Show resolved Hide resolved
Jellyfin.Api/Controllers/MediaSegmentController.cs Outdated Show resolved Hide resolved
Jellyfin.Api/Controllers/MediaSegmentController.cs Outdated Show resolved Hide resolved
Jellyfin.Api/Controllers/MediaSegmentController.cs Outdated Show resolved Hide resolved
Jellyfin.Api/Controllers/MediaSegmentController.cs Outdated Show resolved Hide resolved
Jellyfin.Api/Controllers/MediaSegmentController.cs Outdated Show resolved Hide resolved
Jellyfin.Api/Controllers/MediaSegmentController.cs Outdated Show resolved Hide resolved
Jellyfin.Api/Controllers/MediaSegmentController.cs Outdated Show resolved Hide resolved
Copy link
Member

@nielsvanvelzen nielsvanvelzen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my last review I've asked for better descriptions of the various (API exposed) properties so it's documented what kind of values to expect and how to use them. While some changes were made, some other properties have not been updated (e.g. TypeIndex, still no idea what that is for).

Additionally, some of these changes were made to the <value> element only. The content of those are not used for the generated OpenAPI specification, only the <summary> is. So please update that one as well.

@foux

This comment was marked as off-topic.

@fubar-coder
Copy link

@nielsvanvelzen Regarding the TypeIndex: You can have multiple segments of the same Type in the same media stream. The TypeIndex is used to differentiate between them. In other words: Every media segment can be identified using the media stream (index), the Type, and the TypeIndex.

@jellyfin-bot jellyfin-bot added the merge conflict Merge conflicts should be resolved before a merge label May 15, 2024
@jellyfin-bot

This comment has been minimized.

@nielsvanvelzen
Copy link
Member

@endrl can you update this PR to the latest master branch and address the remaining review feedback?

@hacel
Copy link

hacel commented May 30, 2024

Why is no one allowed to take over this pull request despite the authors' three month disappearance?

@Chr0nos

This comment was marked as off-topic.

@JPVenson

This comment has been minimized.

@JPVenson
Copy link
Member

Hey everyone.

This PR is a hot topic for quite some time now with a lot of back and forth. Lots of people anticipated work and a result of this PR but i unfortunatly have some rather bad news for the current state of this PR. As maybe not many of you know, the jellyfin server team tries to communicate its design ideas and architecture at a seperate repro and this includes a long time discussion about media segments. This discussion jellyfin/jellyfin-meta#30 (comment) however resulted in the server teams decision that a media segement api should be build with a very tight scope and very specific set of features, for example excluding a webapi to create new segements. This is done to ensure the system is as streamlined as possible.

So in discussion with the server team, i have to notify you that this PR will no longer be considered for as long as it does not follow the points laid out in the discussion.

@davidjmorin

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Related to the server backend good first issue Good for newcomers needs testing release-highlight A major new feature for the next release
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.