mirror of https://github.com/ErsatzTV/ErsatzTV.git
Browse Source
* refactor template processing * use template for song xmltv entries * use template for other video xmltv entries * update changelogpull/1604/head
32 changed files with 20492 additions and 425 deletions
@ -0,0 +1,3 @@ |
|||||||
|
namespace ErsatzTV.Core.Domain; |
||||||
|
|
||||||
|
public record SongTag(string Tag, string Value); |
||||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,48 @@ |
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations; |
||||||
|
|
||||||
|
#nullable disable |
||||||
|
|
||||||
|
namespace ErsatzTV.Infrastructure.MySql.Migrations |
||||||
|
{ |
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class Update_SongMetadataParity : Migration |
||||||
|
{ |
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder) |
||||||
|
{ |
||||||
|
migrationBuilder.RenameColumn( |
||||||
|
name: "Date", |
||||||
|
table: "SongMetadata", |
||||||
|
newName: "Comment"); |
||||||
|
|
||||||
|
migrationBuilder.RenameColumn( |
||||||
|
name: "Artist", |
||||||
|
table: "SongMetadata", |
||||||
|
newName: "Artists"); |
||||||
|
|
||||||
|
migrationBuilder.RenameColumn( |
||||||
|
name: "AlbumArtist", |
||||||
|
table: "SongMetadata", |
||||||
|
newName: "AlbumArtists"); |
||||||
|
} |
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder) |
||||||
|
{ |
||||||
|
migrationBuilder.RenameColumn( |
||||||
|
name: "Comment", |
||||||
|
table: "SongMetadata", |
||||||
|
newName: "Date"); |
||||||
|
|
||||||
|
migrationBuilder.RenameColumn( |
||||||
|
name: "Artists", |
||||||
|
table: "SongMetadata", |
||||||
|
newName: "Artist"); |
||||||
|
|
||||||
|
migrationBuilder.RenameColumn( |
||||||
|
name: "AlbumArtists", |
||||||
|
table: "SongMetadata", |
||||||
|
newName: "AlbumArtist"); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,34 @@ |
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations; |
||||||
|
|
||||||
|
#nullable disable |
||||||
|
|
||||||
|
namespace ErsatzTV.Infrastructure.MySql.Migrations |
||||||
|
{ |
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class Reset_SongMetadataTagLib : Migration |
||||||
|
{ |
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder) |
||||||
|
{ |
||||||
|
migrationBuilder.Sql( |
||||||
|
@"UPDATE LibraryPath SET LastScan = '0001-01-01 00:00:00' WHERE Id IN
|
||||||
|
(SELECT LP.Id FROM LibraryPath LP INNER JOIN Library L on L.Id = LP.LibraryId WHERE MediaKind = 5)");
|
||||||
|
|
||||||
|
migrationBuilder.Sql( |
||||||
|
@"UPDATE Library SET LastScan = '0001-01-01 00:00:00' WHERE MediaKind = 5"); |
||||||
|
|
||||||
|
migrationBuilder.Sql( |
||||||
|
@"UPDATE Artwork SET DateUpdated = '0001-01-01 00:00:00' WHERE SongMetadataId IS NOT NULL"); |
||||||
|
|
||||||
|
migrationBuilder.Sql( |
||||||
|
@"UPDATE LibraryFolder SET Etag = NULL WHERE Id IN
|
||||||
|
(SELECT LF.Id FROM LibraryFolder LF INNER JOIN LibraryPath LP on LF.LibraryPathId = LP.Id INNER JOIN Library L on LP.LibraryId = L.Id WHERE MediaKind = 5)");
|
||||||
|
} |
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder) |
||||||
|
{ |
||||||
|
|
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,48 @@ |
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations; |
||||||
|
|
||||||
|
#nullable disable |
||||||
|
|
||||||
|
namespace ErsatzTV.Infrastructure.Sqlite.Migrations |
||||||
|
{ |
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class Update_SongMetadataParity : Migration |
||||||
|
{ |
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder) |
||||||
|
{ |
||||||
|
migrationBuilder.RenameColumn( |
||||||
|
name: "Date", |
||||||
|
table: "SongMetadata", |
||||||
|
newName: "Comment"); |
||||||
|
|
||||||
|
migrationBuilder.RenameColumn( |
||||||
|
name: "Artist", |
||||||
|
table: "SongMetadata", |
||||||
|
newName: "Artists"); |
||||||
|
|
||||||
|
migrationBuilder.RenameColumn( |
||||||
|
name: "AlbumArtist", |
||||||
|
table: "SongMetadata", |
||||||
|
newName: "AlbumArtists"); |
||||||
|
} |
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder) |
||||||
|
{ |
||||||
|
migrationBuilder.RenameColumn( |
||||||
|
name: "Comment", |
||||||
|
table: "SongMetadata", |
||||||
|
newName: "Date"); |
||||||
|
|
||||||
|
migrationBuilder.RenameColumn( |
||||||
|
name: "Artists", |
||||||
|
table: "SongMetadata", |
||||||
|
newName: "Artist"); |
||||||
|
|
||||||
|
migrationBuilder.RenameColumn( |
||||||
|
name: "AlbumArtists", |
||||||
|
table: "SongMetadata", |
||||||
|
newName: "AlbumArtist"); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,34 @@ |
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations; |
||||||
|
|
||||||
|
#nullable disable |
||||||
|
|
||||||
|
namespace ErsatzTV.Infrastructure.Sqlite.Migrations |
||||||
|
{ |
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class Reset_SongMetadataTagLib : Migration |
||||||
|
{ |
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder) |
||||||
|
{ |
||||||
|
migrationBuilder.Sql( |
||||||
|
@"UPDATE LibraryPath SET LastScan = '0001-01-01 00:00:00' WHERE Id IN
|
||||||
|
(SELECT LP.Id FROM LibraryPath LP INNER JOIN Library L on L.Id = LP.LibraryId WHERE MediaKind = 5)");
|
||||||
|
|
||||||
|
migrationBuilder.Sql( |
||||||
|
@"UPDATE Library SET LastScan = '0001-01-01 00:00:00' WHERE MediaKind = 5"); |
||||||
|
|
||||||
|
migrationBuilder.Sql( |
||||||
|
@"UPDATE Artwork SET DateUpdated = '0001-01-01 00:00:00' WHERE SongMetadataId IS NOT NULL"); |
||||||
|
|
||||||
|
migrationBuilder.Sql( |
||||||
|
@"UPDATE LibraryFolder SET Etag = NULL WHERE Id IN
|
||||||
|
(SELECT LF.Id FROM LibraryFolder LF INNER JOIN LibraryPath LP on LF.LibraryPathId = LP.Id INNER JOIN Library L on LP.LibraryId = L.Id WHERE MediaKind = 5)");
|
||||||
|
} |
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder) |
||||||
|
{ |
||||||
|
|
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,52 @@ |
|||||||
|
{{ ## |
||||||
|
|
||||||
|
Available values: |
||||||
|
- programme_start |
||||||
|
- programme_stop |
||||||
|
- channel_number |
||||||
|
- has_custom_title |
||||||
|
- custom_title |
||||||
|
- other_video_title |
||||||
|
- other_video_has_plot |
||||||
|
- other_video_plot |
||||||
|
- other_video_has_year |
||||||
|
- other_video_year |
||||||
|
- other_video_genres |
||||||
|
- other_video_has_content_rating |
||||||
|
- other_video_content_rating |
||||||
|
|
||||||
|
The resulting XML will be minified by ErsatzTV - so feel free to keep things nicely formatted here. |
||||||
|
|
||||||
|
## }} |
||||||
|
|
||||||
|
<programme start="{{ programme_start }}" stop="{{ programme_stop }}" channel="{{ channel_number }}.etv"> |
||||||
|
{{ if has_custom_title }} |
||||||
|
<title lang="en">{{ custom_title }}</title> |
||||||
|
{{ else }} |
||||||
|
<title lang="en">{{ other_video_title }}</title> |
||||||
|
{{ if other_video_has_plot }} |
||||||
|
<desc lang="en">{{ other_video_plot }}</desc> |
||||||
|
{{ end }} |
||||||
|
{{ if other_video_has_year }} |
||||||
|
<date>{{ other_video_year }}</date> |
||||||
|
{{ end }} |
||||||
|
{{ for genre in other_video_genres }} |
||||||
|
<category lang="en">{{ genre }}</category> |
||||||
|
{{ end }} |
||||||
|
{{ if movie_has_artwork }} |
||||||
|
<icon src="{{ movie_artwork_url }}" /> |
||||||
|
{{ end }} |
||||||
|
{{ end }} |
||||||
|
{{ if other_video_has_content_rating }} |
||||||
|
{{ for rating in other_video_content_rating | string.split '/' }} |
||||||
|
{{ if rating | string.starts_with 'us:' }} |
||||||
|
<rating system="MPAA"> |
||||||
|
{{ else }} |
||||||
|
<rating> |
||||||
|
{{ end }} |
||||||
|
<value>{{ rating | string.replace 'us:' '' }}</value> |
||||||
|
</rating> |
||||||
|
{{ end }} |
||||||
|
{{ end }} |
||||||
|
<previously-shown /> |
||||||
|
</programme> |
||||||
@ -0,0 +1,49 @@ |
|||||||
|
{{ ## |
||||||
|
|
||||||
|
Available values: |
||||||
|
- programme_start |
||||||
|
- programme_stop |
||||||
|
- channel_number |
||||||
|
- has_custom_title |
||||||
|
- custom_title |
||||||
|
- song_title |
||||||
|
- song_artists |
||||||
|
- song_album_artists |
||||||
|
- song_has_year |
||||||
|
- song_year |
||||||
|
- song_genres |
||||||
|
- song_has_artwork |
||||||
|
- song_artwork_url |
||||||
|
- song_has_track |
||||||
|
- song_track |
||||||
|
- song_has_comment |
||||||
|
- song_comment |
||||||
|
- song_has_album |
||||||
|
- song_album |
||||||
|
- song_has_release_date |
||||||
|
- song_release_date |
||||||
|
- song_studios |
||||||
|
|
||||||
|
The resulting XML will be minified by ErsatzTV - so feel free to keep things nicely formatted here. |
||||||
|
|
||||||
|
## }} |
||||||
|
|
||||||
|
<programme start="{{ programme_start }}" stop="{{ programme_stop }}" channel="{{ channel_number }}.etv"> |
||||||
|
{{ if has_custom_title }} |
||||||
|
<title lang="en">{{ custom_title }}</title> |
||||||
|
{{ else }} |
||||||
|
<title lang="en">{{ song_artists | array.join ', ' }}</title> |
||||||
|
<sub-title lang="en">{{ song_title }}</sub-title> |
||||||
|
{{ if song_has_year }} |
||||||
|
<date>{{ song_year }}</date> |
||||||
|
{{ end }} |
||||||
|
<category lang="en">Music</category> |
||||||
|
{{ for genre in song_genres }} |
||||||
|
<category lang="en">{{ genre }}</category> |
||||||
|
{{ end }} |
||||||
|
{{ if song_has_artwork }} |
||||||
|
<icon src="{{ song_artwork_url }}" /> |
||||||
|
{{ end }} |
||||||
|
{{ end }} |
||||||
|
<previously-shown /> |
||||||
|
</programme> |
||||||
Loading…
Reference in new issue