Skip to content

Commit 21e8e72

Browse files
committed
Ressed ids and fixed quotes in ffmpeg params
1 parent f4b6ac7 commit 21e8e72

14 files changed

+4083
-1245
lines changed
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
using Microsoft.EntityFrameworkCore;
2+
using Microsoft.EntityFrameworkCore.Metadata.Builders;
3+
4+
namespace Jellyfin.HardwareVisualizer.Server.Database.Configuration;
5+
6+
public class FfmpegVersionConfig : IEntityTypeConfiguration<FfmpegVersion>
7+
{
8+
public static Guid WindowsVersionGroup = new Guid("3b20be6a-7c32-41a0-a6ca-259937e69512");
9+
public static Guid GenericLinuxVersionGroup = new Guid("9F9565F1-4661-484B-8C80-433BC909E70F");
10+
public static Guid MacVersionGroup = new Guid("3504C0A3-19B6-418D-995E-C8731C9789A5");
11+
12+
public void Configure(EntityTypeBuilder<FfmpegVersion> modelBuilder)
13+
{
14+
modelBuilder
15+
.HasData(new FfmpegVersion[]
16+
{
17+
new FfmpegVersion()
18+
{
19+
Id = new Guid("A3F734BE-FB92-4A1F-BD8C-B6701E0F7E9F"),
20+
PlatformId = new Guid("2C361BE8-C0EC-4020-984B-66C620DAD840"),
21+
Source =
22+
"https://repo.jellyfin.org/files/ffmpeg/windows/latest-5.x/amd64/jellyfin-ffmpeg_5.1.4-3-portable_win64.zip",
23+
Version = "5.1.6-3",
24+
HashSha256 = "824542b798f04c482b171417002c3aee94f880eec2aa1ee9f016de6d912e31bd",
25+
HashMd5 = "73a6a7f9d02a9abbda0f6aadd39abc89",
26+
VersionGroup = FfmpegVersionConfig.WindowsVersionGroup,
27+
},
28+
new FfmpegVersion()
29+
{
30+
Id = new Guid("7F9E0BB6-7346-400F-881C-33C3C1558D78"),
31+
PlatformId = new Guid("79191671-CAA0-4B52-8A9E-EAA2F040A1CC"),
32+
Source =
33+
"https://repo.jellyfin.org/files/ffmpeg/windows/latest-5.x/amd64/jellyfin-ffmpeg_5.1.4-3-portable_win64.zip",
34+
Version = "5.1.6-3",
35+
HashSha256 = "824542b798f04c482b171417002c3aee94f880eec2aa1ee9f016de6d912e31bd",
36+
HashMd5 = "73a6a7f9d02a9abbda0f6aadd39abc89",
37+
VersionGroup = FfmpegVersionConfig.WindowsVersionGroup,
38+
},
39+
new FfmpegVersion()
40+
{
41+
Id = new Guid("2C720157-F8FB-48C9-8686-D4DFE7DAAE9A"),
42+
PlatformId = new Guid("8D58B84B-73DC-4275-985D-123ABE886818"),
43+
Source =
44+
"https://repo.jellyfin.org/files/ffmpeg/linux/6.x/6.0.1-7/amd64/jellyfin-ffmpeg_6.0.1-7_portable_linux64-gpl.tar.xz",
45+
Version = "6.0.1-7",
46+
HashSha256 = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
47+
HashMd5 = "d41d8cd98f00b204e9800998ecf8427e",
48+
VersionGroup = FfmpegVersionConfig.GenericLinuxVersionGroup,
49+
},
50+
new FfmpegVersion()
51+
{
52+
Id = new Guid("501d7e27-8410-40af-b48d-1e7ce0002173"),
53+
PlatformId = new Guid("3657b420-2f2a-4940-8ed3-ee70b9b3720d"),
54+
Source =
55+
"https://repo.jellyfin.org/files/ffmpeg/linux/6.x/6.0.1-7/amd64/jellyfin-ffmpeg_6.0.1-7_portable_linux64-gpl.tar.xz",
56+
Version = "6.0.1-7",
57+
HashSha256 = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
58+
HashMd5 = "d41d8cd98f00b204e9800998ecf8427e",
59+
VersionGroup = FfmpegVersionConfig.GenericLinuxVersionGroup,
60+
},
61+
new FfmpegVersion()
62+
{
63+
Id = new Guid("5AF82644-47A0-4C0C-AB83-31A5DFF71153"),
64+
PlatformId = new Guid("5AEA52AB-60BF-4425-B412-C046A60CCC83"),
65+
Source =
66+
"https://repo.jellyfin.org/files/ffmpeg/macos/7.x/7.0.2-3/x86_64/jellyfin-ffmpeg_7.0.2-3_portable_mac64-gpl.tar.xz",
67+
Version = "7.0.2-3",
68+
HashSha256 = "ed4061fc90e35ac405cb824dc99781481879a20e0a6b447934ddadd54bc40b3d",
69+
HashMd5 = "db3ede0396234e92991f45c5ef9058b7",
70+
VersionGroup = FfmpegVersionConfig.MacVersionGroup,
71+
},
72+
new FfmpegVersion()
73+
{
74+
Id = new Guid("413B53ED-E63F-4410-B901-492173CABF13"),
75+
PlatformId = new Guid("6CF9234F-A4BB-4099-8FC8-675A653BA573"),
76+
Source =
77+
"https://repo.jellyfin.org/files/ffmpeg/macos/7.x/7.0.2-3/arm64/jellyfin-ffmpeg_7.0.2-3_portable_macarm64-gpl.tar.xz",
78+
Version = "7.0.2-3",
79+
HashSha256 = "4f3eb2bf612e989d218a26c822d5d008cf3c4eafc54cf41e7816fc2eefc73d10",
80+
HashMd5 = "bc6b6e09b2ec13871250f866e87952e8",
81+
VersionGroup = FfmpegVersionConfig.MacVersionGroup,
82+
}
83+
});
84+
}
85+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
using Microsoft.EntityFrameworkCore;
2+
using Microsoft.EntityFrameworkCore.Metadata.Builders;
3+
4+
namespace Jellyfin.HardwareVisualizer.Server.Database.Configuration;
5+
6+
public class HardwareCodecConfig : IEntityTypeConfiguration<HardwareCodec>
7+
{
8+
public static Guid h264CodecId = new Guid("BF2065DC-9B03-48B8-9A30-206A12A6319C");
9+
public static Guid hvecCodecId = new Guid("104537DB-E1E2-4490-A82A-AFAEDE9A8FD4");
10+
public void Configure(EntityTypeBuilder<HardwareCodec> modelBuilder)
11+
{
12+
modelBuilder
13+
.HasData(new HardwareCodec[]
14+
{
15+
new HardwareCodec()
16+
{
17+
Id = HardwareCodecConfig.h264CodecId,
18+
Identifier = "h264",
19+
Name = "H264"
20+
},
21+
new HardwareCodec()
22+
{
23+
Id = HardwareCodecConfig.hvecCodecId,
24+
Identifier = "h265",
25+
Name = "HVEC"
26+
},
27+
});
28+
}
29+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using System;
2+
using System.Text;
3+
using Microsoft.EntityFrameworkCore;
4+
using Microsoft.EntityFrameworkCore.Metadata.Builders;
5+
6+
namespace Jellyfin.HardwareVisualizer.Server.Database.Configuration;
7+
8+
public class HardwareDisplayConfig : IEntityTypeConfiguration<HardwareDisplay>
9+
{
10+
public void Configure(EntityTypeBuilder<HardwareDisplay> modelBuilder)
11+
{
12+
modelBuilder
13+
.HasKey(e => new { e.HardwareCodec, e.ToResolution, e.FromResolution, e.DeviceType, e.DeviceName });
14+
}
15+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
using System.Security.Cryptography;
2+
3+
namespace Jellyfin.HardwareVisualizer.Server.Database.Configuration;
4+
5+
public static class IdGenerator
6+
{
7+
public static TestCaseArgument GetWithId(this TestCaseArgument testCaseArgument)
8+
{
9+
return testCaseArgument with
10+
{
11+
Id = new Guid(Get16BitHash(testCaseArgument.GetHashCode()))
12+
};
13+
}
14+
15+
public static IEnumerable<TestCaseArgument> GetWithId(this IEnumerable<TestCaseArgument> testCaseArgument)
16+
{
17+
return testCaseArgument.Select(GetWithId);
18+
}
19+
20+
public static TestCase GetWithId(this TestCase testCase)
21+
{
22+
return testCase with
23+
{
24+
Id = new Guid(Get16BitHash(testCase.GetHashCode()))
25+
};
26+
}
27+
28+
public static IEnumerable<TestCase> GetWithId(this IEnumerable<TestCase> testCaseArgument)
29+
{
30+
return testCaseArgument.Select(GetWithId);
31+
}
32+
33+
public static byte[] Get16BitHash(int input)
34+
{
35+
using (var md5Hasher = MD5.Create())
36+
{
37+
var data = md5Hasher.ComputeHash(BitConverter.GetBytes(input));
38+
39+
var target = new byte[16];
40+
for (int i = 0; i < data.Length; i++)
41+
{
42+
target[i % 16] |= data[i];
43+
}
44+
return target;
45+
}
46+
}
47+
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
using Microsoft.EntityFrameworkCore;
2+
using Microsoft.EntityFrameworkCore.Metadata.Builders;
3+
4+
namespace Jellyfin.HardwareVisualizer.Server.Database.Configuration;
5+
6+
public class MediaTestFileConfig : IEntityTypeConfiguration<MediaTestFile>
7+
{
8+
public void Configure(EntityTypeBuilder<MediaTestFile> modelBuilder)
9+
{
10+
modelBuilder.HasData(new MediaTestFile[]
11+
{
12+
new MediaTestFile()
13+
{
14+
Id = new Guid("E8A75E65-A3F3-4D92-A45B-84E71A13EFAB"),
15+
Name = "jellyfish-120-mbps-4k-uhd-hevc-10bit",
16+
SourceUrl = "https://repo.jellyfin.org/jellyfish/media/jellyfish-120-mbps-4k-uhd-hevc-10bit.mkv",
17+
Bitrate = 120,
18+
Size = 429,
19+
VideoCodec = "HEVC",
20+
AudioCodec = "",
21+
HashSha256 = "",
22+
HashMd5 = "",
23+
},
24+
new MediaTestFile()
25+
{
26+
Id = new Guid("E1E58B15-6664-454C-868A-20442DB30557"),
27+
Name = "jellyfish-120-mbps-4k-uhd-h264",
28+
SourceUrl = "https://repo.jellyfin.org/jellyfish/media/jellyfish-120-mbps-4k-uhd-h264.mkv",
29+
Bitrate = 120,
30+
Size = 431,
31+
VideoCodec = "h264",
32+
AudioCodec = "",
33+
HashSha256 = "",
34+
HashMd5 = "",
35+
},
36+
new MediaTestFile()
37+
{
38+
Id = new Guid("70DAEBE7-C9FC-4E02-A524-2FC825A49355"),
39+
Name = "jellyfish-40-mbps-hd-hevc-10bit",
40+
SourceUrl = "https://repo.jellyfin.org/jellyfish/media/jellyfish-40-mbps-hd-hevc-10bit.mkv",
41+
Bitrate = 40,
42+
Size = 143,
43+
VideoCodec = "HEVC",
44+
AudioCodec = "",
45+
HashSha256 = "",
46+
HashMd5 = "",
47+
},
48+
new MediaTestFile()
49+
{
50+
Id = new Guid("1D943D13-586D-4562-A968-EB1D0FFAE947"),
51+
Name = "jellyfish-40-mbps-hd-h264",
52+
SourceUrl = "https://repo.jellyfin.org/jellyfish/media/jellyfish-40-mbps-hd-h264.mkv",
53+
Bitrate = 40,
54+
Size = 142,
55+
VideoCodec = "h264",
56+
AudioCodec = "",
57+
HashSha256 = "",
58+
HashMd5 = "",
59+
}
60+
});
61+
}
62+
}
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
using Microsoft.EntityFrameworkCore;
2+
using Microsoft.EntityFrameworkCore.Metadata.Builders;
3+
4+
namespace Jellyfin.HardwareVisualizer.Server.Database.Configuration;
5+
6+
public class PlatformConfig : IEntityTypeConfiguration<Platform>
7+
{
8+
public void Configure(EntityTypeBuilder<Platform> modelBuilder)
9+
{
10+
modelBuilder.HasData(new Platform[]
11+
{
12+
new Platform()
13+
{
14+
Id = new Guid("2C361BE8-C0EC-4020-984B-66C620DAD840"),
15+
Name = "Windows 11",
16+
Type = PlatformType.Windows,
17+
Version = "Windows 11 version 23H2",
18+
VersionId = "22631",
19+
DisplayName = "Windows 11",
20+
Supported = true,
21+
Architecture = PlatformArchitecture.Amd64
22+
},
23+
new Platform()
24+
{
25+
Id = new Guid("79191671-CAA0-4B52-8A9E-EAA2F040A1CC"),
26+
Name = "Windows 10",
27+
Type = PlatformType.Windows,
28+
Version = "Windows 10 version 22H2",
29+
VersionId = "19045",
30+
DisplayName = "Windows 10",
31+
Supported = true,
32+
Architecture = PlatformArchitecture.Amd64
33+
},
34+
new Platform()
35+
{
36+
Id = new Guid("8D58B84B-73DC-4275-985D-123ABE886818"),
37+
Name = "Ubuntu",
38+
Type = PlatformType.Linux,
39+
Version = "Ubuntu",
40+
VersionId = "22.04",
41+
DisplayName = "Ubuntu Focal",
42+
Supported = true,
43+
Architecture = PlatformArchitecture.Amd64
44+
},
45+
new Platform()
46+
{
47+
Id = new Guid("3657b420-2f2a-4940-8ed3-ee70b9b3720d"),
48+
Name = "Linux Generic",
49+
Type = PlatformType.Linux,
50+
Version = "Linux",
51+
VersionId = "Generic",
52+
DisplayName = "Linux Generic",
53+
Supported = true,
54+
Architecture = PlatformArchitecture.Amd64
55+
},
56+
new Platform()
57+
{
58+
Id = new Guid("5AEA52AB-60BF-4425-B412-C046A60CCC83"),
59+
Name = "MacOS",
60+
Type = PlatformType.Mac,
61+
Version = "14.5",
62+
VersionId = "14.5",
63+
DisplayName = "Mac OS Darwin",
64+
Supported = true,
65+
Architecture = PlatformArchitecture.Amd64
66+
},
67+
new Platform()
68+
{
69+
Id = new Guid("6CF9234F-A4BB-4099-8FC8-675A653BA573"),
70+
Name = "MacOS",
71+
Type = PlatformType.Mac,
72+
Version = "14.5",
73+
VersionId = "14.5",
74+
DisplayName = "Mac OS Darwin",
75+
Supported = true,
76+
Architecture = PlatformArchitecture.Arm64
77+
}
78+
});
79+
}
80+
}

0 commit comments

Comments
 (0)