Browse Source

randomize default backgrounds (#504)

* randomize default song backgrounds

* update docs
pull/507/head
Jason Dove 4 years ago committed by GitHub
parent
commit
a6b15f68c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 20
      ErsatzTV.Application/Streaming/Queries/GetPlayoutItemProcessByChannelNumberHandler.cs
  2. 4
      ErsatzTV/ErsatzTV.csproj
  3. BIN
      ErsatzTV/Resources/background_blank.png
  4. BIN
      ErsatzTV/Resources/background_e.png
  5. BIN
      ErsatzTV/Resources/background_t.png
  6. BIN
      ErsatzTV/Resources/background_v.png
  7. 4
      ErsatzTV/Services/RunOnce/ResourceExtractorService.cs
  8. 2
      README.md
  9. 2
      docs/user-guide/add-media-items.md
  10. 22
      docs/user-guide/local-libraries.md
  11. 11
      docs/user-guide/search.md

20
ErsatzTV.Application/Streaming/Queries/GetPlayoutItemProcessByChannelNumberHandler.cs

@ -148,8 +148,8 @@ namespace ErsatzTV.Application.Streaming.Queries @@ -148,8 +148,8 @@ namespace ErsatzTV.Application.Streaming.Queries
{
Id = -1,
Chapters = new List<MediaChapter>(),
Width = 301,
Height = 162,
Width = 192,
Height = 108,
SampleAspectRatio = "1:1",
Streams = new List<MediaStream>
{
@ -157,8 +157,20 @@ namespace ErsatzTV.Application.Streaming.Queries @@ -157,8 +157,20 @@ namespace ErsatzTV.Application.Streaming.Queries
}
};
// use ETV logo by default
string artworkPath = Path.Combine(FileSystemLayout.ResourcesCacheFolder, "ErsatzTV.png");
string[] backgrounds =
{
"background_blank.png",
"background_e.png",
"background_t.png",
"background_v.png"
};
var random = new Random();
// use random ETV color by default
string artworkPath = Path.Combine(
FileSystemLayout.ResourcesCacheFolder,
backgrounds[random.Next() % backgrounds.Length]);
// use thumbnail (cover art) if present
foreach (SongMetadata metadata in song.SongMetadata)

4
ErsatzTV/ErsatzTV.csproj

@ -51,6 +51,10 @@ @@ -51,6 +51,10 @@
<ItemGroup>
<EmbeddedResource Include="Resources\background.png" />
<EmbeddedResource Include="Resources\background_blank.png" />
<EmbeddedResource Include="Resources\background_e.png" />
<EmbeddedResource Include="Resources\background_t.png" />
<EmbeddedResource Include="Resources\background_v.png" />
<EmbeddedResource Include="Resources\ErsatzTV.png" />
<EmbeddedResource Include="Resources\Roboto-Regular.ttf" />
<EmbeddedResource Include="Resources\OPTIKabel-Heavy.otf" />

BIN
ErsatzTV/Resources/background_blank.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
ErsatzTV/Resources/background_e.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
ErsatzTV/Resources/background_t.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
ErsatzTV/Resources/background_v.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

4
ErsatzTV/Services/RunOnce/ResourceExtractorService.cs

@ -19,6 +19,10 @@ namespace ErsatzTV.Services.RunOnce @@ -19,6 +19,10 @@ namespace ErsatzTV.Services.RunOnce
Assembly assembly = typeof(ResourceExtractorService).GetTypeInfo().Assembly;
await ExtractResource(assembly, "background.png", cancellationToken);
await ExtractResource(assembly, "background_blank.png", cancellationToken);
await ExtractResource(assembly, "background_e.png", cancellationToken);
await ExtractResource(assembly, "background_t.png", cancellationToken);
await ExtractResource(assembly, "background_v.png", cancellationToken);
await ExtractResource(assembly, "ErsatzTV.png", cancellationToken);
await ExtractResource(assembly, "Roboto-Regular.ttf", cancellationToken);
await ExtractResource(assembly, "OPTIKabel-Heavy.otf", cancellationToken);

2
README.md

@ -17,7 +17,7 @@ Want to join the community or have a question? Join us on [Discord](https://disc @@ -17,7 +17,7 @@ Want to join the community or have a question? Join us on [Discord](https://disc
- [Plex](https://www.plex.tv/) media and metadata
- [Jellyfin](https://jellyfin.org/) media and metadata
- [Emby](https://emby.media/) media and metadata
- Music video libraries
- Song and music video libraries
- Pre-roll, mid-roll, post-roll filler options
## License

2
docs/user-guide/add-media-items.md

@ -11,7 +11,7 @@ With local libraries, ErsatzTV will read metadata from [NFO files](https://kodi. @@ -11,7 +11,7 @@ With local libraries, ErsatzTV will read metadata from [NFO files](https://kodi.
### Add Libraries
ErsatzTV provides four local libraries by default, one for each supported media kind: `Movies`, `Shows`, `Music Videos` and `Other Videos`.
ErsatzTV provides four local libraries by default, one for each supported media kind: `Movies`, `Shows`, `Music Videos`, `Other Videos` and `Songs`.
Additional libraries can be added under `Media Sources` > `Local`.
### Add Media Items

22
docs/user-guide/local-libraries.md

@ -126,3 +126,25 @@ Your other video library will then have two media items with the following metad @@ -126,3 +126,25 @@ Your other video library will then have two media items with the following metad
1. title: `1990 Car Commercial 1`, tags: `Commercials`, `1990`, `Cars`
2. title: `1992 Car Commercial 1`, tags: `Commercials`, `1992`, `Cars`
## Songs
### Folder Layout
The `Songs` library has no folder requirements, but folders can be a useful source of metadata.
### Songs Metadata
Songs will have basic metadata pulled from embedded tags (artist, album, title).
### Songs Fallback Metadata
Songs will have a tag added to their metadata for every containing folder, including the top-level folder. As an example, consider adding a commercials folder with the following files:
- `Rock\Awesome Band\Awesome Album\01 Track 1.flac`
- `Rock\Awesome Band\Better Album\05 Track 5.flac`
Your other video library will then have two media items with the following metadata:
1. title: `01 Track 1`, tags: `Rock`, `Awesome Band`, `Awesome Album`
2. title: `05 Track 5`, tags: `Rock`, `Awesome Band`, `Better Album`

11
docs/user-guide/search.md

@ -90,6 +90,17 @@ The following fields are available for searching other videos: @@ -90,6 +90,17 @@ The following fields are available for searching other videos:
- `minutes`: the rounded-up whole number duration of the video in minutes
- `type`: Always `other_video`
### Songs
The following fields are available for searching songs:
- `title`: The song title, or the filename of the song (without extension)
- `album`: The song album
- `artist`: The song artist
- `tag`: All of the song's parent folders
- `minutes`: the rounded-up whole number duration of the song in minutes
- `type`: Always `song`
## Special Search Fields
- `released_inthelast`: For any media type that supports `release_date`, `released_inthelast` takes a number and a unit (days, weeks, months, years) and returns items released between the specified time ago and now

Loading…
Cancel
Save