mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-13 12:16:49 +01:00
Add OriginalLanguage as option to PreferredAudioLanguage (#12579)
* Add OriginalLanguage as option to PreferredAudioLanguage * Support for multiple original languages * Add original audio stream indicator * Fetch OriginalLanguage from TMDB * Adapt to EFCore refactor * Fix PlayDefaultAudioTrack OriginalLanguage behavior * Fix better PlayDefaultAudioTrack OriginalLanguage behavior * Add comment to ItemFields * Improved PlayDefaultAudioTrack behavior * Add migration for original language * Use sting.Equals for string comparisons * Always set dto OriginalLanguage * Remove OriginalLanguage from ItemFields --------- Co-authored-by: Lampan-git <lampan-git@users.noreply.github.com>
This commit is contained in:
@@ -96,6 +96,8 @@ public class BaseItemEntity
|
||||
|
||||
public string? OriginalTitle { get; set; }
|
||||
|
||||
public string? OriginalLanguage { get; set; }
|
||||
|
||||
public Guid? PrimaryVersionId { get; set; }
|
||||
|
||||
public DateTime? DateLastMediaAdded { get; set; }
|
||||
|
||||
@@ -62,6 +62,16 @@ namespace Jellyfin.Database.Implementations.Entities.Libraries
|
||||
[StringLength(1024)]
|
||||
public string? OriginalTitle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the original language.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Max length = 1024.
|
||||
/// </remarks>
|
||||
[MaxLength(1024)]
|
||||
[StringLength(1024)]
|
||||
public string? OriginalLanguage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the sort title.
|
||||
/// </summary>
|
||||
|
||||
@@ -40,6 +40,8 @@ public class MediaStreamInfo
|
||||
|
||||
public bool IsExternal { get; set; }
|
||||
|
||||
public bool IsOriginal { get; set; }
|
||||
|
||||
public int? Height { get; set; }
|
||||
|
||||
public int? Width { get; set; }
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Jellyfin.Database.Providers.Sqlite.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddOriginalLanguage : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsOriginal",
|
||||
table: "MediaStreamInfos",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "OriginalLanguage",
|
||||
table: "BaseItems",
|
||||
type: "TEXT",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "BaseItems",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("00000000-0000-0000-0000-000000000001"),
|
||||
column: "OriginalLanguage",
|
||||
value: null);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsOriginal",
|
||||
table: "MediaStreamInfos");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "OriginalLanguage",
|
||||
table: "BaseItems");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -264,6 +264,9 @@ namespace Jellyfin.Server.Implementations.Migrations
|
||||
b.Property<string>("OfficialRating")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("OriginalLanguage")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("OriginalTitle")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
@@ -955,6 +958,9 @@ namespace Jellyfin.Server.Implementations.Migrations
|
||||
b.Property<bool?>("IsInterlaced")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<bool>("IsOriginal")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("KeyFrames")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user