-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using System.Text.Json; | ||
using CasCap.Models; | ||
using OneShelf.Videos.Database; | ||
using OneShelf.Videos.Database.Models; | ||
|
||
namespace OneShelf.Videos.App.Services; | ||
|
||
public class VideosDatabaseOperations(VideosDatabase videosDatabase) | ||
{ | ||
public void AddItems(IEnumerable<(long chatId, int messageId, string path, DateTime publishedOn, NewMediaItemResult result, DateTime? fileNameTimestamp)> items) | ||
{ | ||
videosDatabase.UploadedItems.AddRange(items.Select(i => new UploadedItem | ||
{ | ||
CreatedOn = DateTime.Now, | ||
ChatId = i.chatId, | ||
MessageId = i.messageId, | ||
TelegramPublishedOn = i.publishedOn, | ||
Status = i.result.status.status, | ||
StatusCode = i.result.status.code, | ||
StatusMessage = i.result.status.message, | ||
MediaItemId = i.result.mediaItem?.id, | ||
MediaItemIsPhoto = i.result.mediaItem?.isPhoto, | ||
MediaItemIsVideo = i.result.mediaItem?.isVideo, | ||
MediaItemMimeType = i.result.mediaItem?.mimeType, | ||
MediaItemSyncDate = i.result.mediaItem?.syncDate, | ||
MediaItemMetadataCreationTime = i.result.mediaItem?.mediaMetadata?.creationTime, | ||
Json = JsonSerializer.Serialize(i.result.mediaItem), | ||
FileNameTimestamp = i.fileNameTimestamp, | ||
})); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.