mirror of
				https://github.com/zoriya/Kyoo.git
				synced 2025-10-31 02:27:11 -04:00 
			
		
		
		
	Allowing custom logo extensions for providers
This commit is contained in:
		
							parent
							
								
									a620cc1818
								
							
						
					
					
						commit
						a7f3dcc341
					
				| @ -149,7 +149,6 @@ namespace Kyoo.Controllers | |||||||
| 		{ | 		{ | ||||||
| 			if (provider == null) | 			if (provider == null) | ||||||
| 				throw new ArgumentNullException(nameof(provider)); | 				throw new ArgumentNullException(nameof(provider)); | ||||||
| 			// TODO add a image's type on the provider to allow svg here. |  | ||||||
| 			// TODO fix trailer display. | 			// TODO fix trailer display. | ||||||
| 			string thumbPath = Path.GetFullPath(Path.Combine(_providerPath, $"{provider.Slug}.{provider.LogoExtension}")); | 			string thumbPath = Path.GetFullPath(Path.Combine(_providerPath, $"{provider.Slug}.{provider.LogoExtension}")); | ||||||
| 			return Task.FromResult(thumbPath.StartsWith(_providerPath) ? thumbPath : null); | 			return Task.FromResult(thumbPath.StartsWith(_providerPath) ? thumbPath : null); | ||||||
|  | |||||||
| @ -10,7 +10,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; | |||||||
| namespace Kyoo.Models.DatabaseMigrations.Internal | namespace Kyoo.Models.DatabaseMigrations.Internal | ||||||
| { | { | ||||||
|     [DbContext(typeof(DatabaseContext))] |     [DbContext(typeof(DatabaseContext))] | ||||||
|     [Migration("20210317220956_Initial")] |     [Migration("20210325184215_Initial")] | ||||||
|     partial class Initial |     partial class Initial | ||||||
|     { |     { | ||||||
|         protected override void BuildTargetModel(ModelBuilder modelBuilder) |         protected override void BuildTargetModel(ModelBuilder modelBuilder) | ||||||
| @ -19,7 +19,7 @@ namespace Kyoo.Models.DatabaseMigrations.Internal | |||||||
|             modelBuilder |             modelBuilder | ||||||
|                 .HasPostgresEnum(null, "item_type", new[] { "show", "movie", "collection" }) |                 .HasPostgresEnum(null, "item_type", new[] { "show", "movie", "collection" }) | ||||||
|                 .HasPostgresEnum(null, "status", new[] { "finished", "airing", "planned", "unknown" }) |                 .HasPostgresEnum(null, "status", new[] { "finished", "airing", "planned", "unknown" }) | ||||||
|                 .HasPostgresEnum(null, "stream_type", new[] { "unknown", "video", "audio", "subtitle", "font" }) |                 .HasPostgresEnum(null, "stream_type", new[] { "unknown", "video", "audio", "subtitle", "attachment" }) | ||||||
|                 .HasAnnotation("Relational:MaxIdentifierLength", 63) |                 .HasAnnotation("Relational:MaxIdentifierLength", 63) | ||||||
|                 .HasAnnotation("ProductVersion", "5.0.3") |                 .HasAnnotation("ProductVersion", "5.0.3") | ||||||
|                 .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); |                 .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); | ||||||
| @ -330,6 +330,9 @@ namespace Kyoo.Models.DatabaseMigrations.Internal | |||||||
|                     b.Property<string>("Logo") |                     b.Property<string>("Logo") | ||||||
|                         .HasColumnType("text"); |                         .HasColumnType("text"); | ||||||
| 
 | 
 | ||||||
|  |                     b.Property<string>("LogoExtension") | ||||||
|  |                         .HasColumnType("text"); | ||||||
|  | 
 | ||||||
|                     b.Property<string>("Name") |                     b.Property<string>("Name") | ||||||
|                         .HasColumnType("text"); |                         .HasColumnType("text"); | ||||||
| 
 | 
 | ||||||
| @ -11,7 +11,7 @@ namespace Kyoo.Models.DatabaseMigrations.Internal | |||||||
|             migrationBuilder.AlterDatabase() |             migrationBuilder.AlterDatabase() | ||||||
|                 .Annotation("Npgsql:Enum:item_type", "show,movie,collection") |                 .Annotation("Npgsql:Enum:item_type", "show,movie,collection") | ||||||
|                 .Annotation("Npgsql:Enum:status", "finished,airing,planned,unknown") |                 .Annotation("Npgsql:Enum:status", "finished,airing,planned,unknown") | ||||||
|                 .Annotation("Npgsql:Enum:stream_type", "unknown,video,audio,subtitle,font"); |                 .Annotation("Npgsql:Enum:stream_type", "unknown,video,audio,subtitle,attachment"); | ||||||
| 
 | 
 | ||||||
|             migrationBuilder.CreateTable( |             migrationBuilder.CreateTable( | ||||||
|                 name: "Collections", |                 name: "Collections", | ||||||
| @ -81,7 +81,8 @@ namespace Kyoo.Models.DatabaseMigrations.Internal | |||||||
|                         .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), |                         .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), | ||||||
|                     Slug = table.Column<string>(type: "text", nullable: false), |                     Slug = table.Column<string>(type: "text", nullable: false), | ||||||
|                     Name = table.Column<string>(type: "text", nullable: true), |                     Name = table.Column<string>(type: "text", nullable: true), | ||||||
|                     Logo = table.Column<string>(type: "text", nullable: true) |                     Logo = table.Column<string>(type: "text", nullable: true), | ||||||
|  |                     LogoExtension = table.Column<string>(type: "text", nullable: true) | ||||||
|                 }, |                 }, | ||||||
|                 constraints: table => |                 constraints: table => | ||||||
|                 { |                 { | ||||||
| @ -17,7 +17,7 @@ namespace Kyoo.Models.DatabaseMigrations.Internal | |||||||
|             modelBuilder |             modelBuilder | ||||||
|                 .HasPostgresEnum(null, "item_type", new[] { "show", "movie", "collection" }) |                 .HasPostgresEnum(null, "item_type", new[] { "show", "movie", "collection" }) | ||||||
|                 .HasPostgresEnum(null, "status", new[] { "finished", "airing", "planned", "unknown" }) |                 .HasPostgresEnum(null, "status", new[] { "finished", "airing", "planned", "unknown" }) | ||||||
|                 .HasPostgresEnum(null, "stream_type", new[] { "unknown", "video", "audio", "subtitle", "font" }) |                 .HasPostgresEnum(null, "stream_type", new[] { "unknown", "video", "audio", "subtitle", "attachment" }) | ||||||
|                 .HasAnnotation("Relational:MaxIdentifierLength", 63) |                 .HasAnnotation("Relational:MaxIdentifierLength", 63) | ||||||
|                 .HasAnnotation("ProductVersion", "5.0.3") |                 .HasAnnotation("ProductVersion", "5.0.3") | ||||||
|                 .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); |                 .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); | ||||||
| @ -328,6 +328,9 @@ namespace Kyoo.Models.DatabaseMigrations.Internal | |||||||
|                     b.Property<string>("Logo") |                     b.Property<string>("Logo") | ||||||
|                         .HasColumnType("text"); |                         .HasColumnType("text"); | ||||||
| 
 | 
 | ||||||
|  |                     b.Property<string>("LogoExtension") | ||||||
|  |                         .HasColumnType("text"); | ||||||
|  | 
 | ||||||
|                     b.Property<string>("Name") |                     b.Property<string>("Name") | ||||||
|                         .HasColumnType("text"); |                         .HasColumnType("text"); | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user