-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
192 additions
and
1,109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,36 @@ | ||
using System.ComponentModel.DataAnnotations.Schema; | ||
using Microsoft.EntityFrameworkCore; | ||
using Dapper.Contrib.Extensions; | ||
using Lazy; | ||
using YoutubeExplode.Common; | ||
using YoutubeExplode.Videos; | ||
|
||
namespace Console.Database; | ||
|
||
[PrimaryKey("Id")] | ||
internal class LocalSong : IVideo | ||
{ | ||
[Key] | ||
public required string Id { get; set; } | ||
public required string Url { get; set; } | ||
public required string Title { get; set; } | ||
public required string ChannelId { get; set; } | ||
public required string ChannelTitle { get; set; } | ||
public required TimeSpan? Duration { get; set; } | ||
public required double DurationMiliseconds { get; set; } | ||
|
||
[NotMapped] | ||
[Computed] | ||
[Lazy] | ||
public TimeSpan? Duration => TimeSpan.FromMilliseconds(DurationMiliseconds); | ||
|
||
[Computed] | ||
//Not saved for now, only to satisfy IVideo | ||
public IReadOnlyList<Thumbnail> Thumbnails { get; } = []; | ||
|
||
[Computed] | ||
public ICollection<LocalPlaylistSong>? PlaylistSongs { get; set; } | ||
|
||
[Computed] | ||
[Lazy] | ||
VideoId IVideo.Id => new(Id); | ||
|
||
[Computed] | ||
[Lazy] | ||
Author IVideo.Author => new(ChannelId, ChannelTitle); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
using Microsoft.EntityFrameworkCore; | ||
using Dapper.Contrib.Extensions; | ||
|
||
namespace Console.Database; | ||
|
||
[PrimaryKey("Id")] | ||
internal class Setting | ||
{ | ||
[Key] | ||
public int Id { get; set; } | ||
public int Volume { get; set; } | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.