Skip to content

Commit

Permalink
exif service extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-zhur committed Sep 25, 2024
1 parent 6ef4054 commit 12d6bf9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion OneShelf.Videos/OneShelf.Videos.App/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

var service1 = host.Services.GetRequiredService<Service1>();
var service2 = host.Services.GetRequiredService<Service2>();
var service3 = host.Services.GetRequiredService<Service3>();
var service3 = host.Services.GetRequiredService<ExifService>();
var service4 = host.Services.GetRequiredService<LiveDownloader>();

await using var videosDatabase = host.Services.GetRequiredService<VideosDatabase>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static IServiceCollection AddVideosBusinessLogic(this IServiceCollection
.Configure<VideosOptions>(o => configuration.GetSection(nameof(VideosOptions)).Bind(o))
.AddScoped<Service1>()
.AddScoped<Service2>()
.AddScoped<Service3>()
.AddScoped<ExifService>()
.AddScoped<LiveDownloader>()
.AddSingleton<TelegramLoggerInitializer>()
.AddScoped<VideosDatabaseOperations>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace OneShelf.Videos.BusinessLogic.Services;

public class Service3
public class ExifService
{
public async Task<DateTime> SetExifTimestamp(string path, string tempFileName)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ public class Service2
private readonly ILogger<Service2> _logger;
private readonly VideosDatabase _videosDatabase;
private readonly VideosDatabaseOperations _videosDatabaseOperations;
private readonly Service3 _service3;
private readonly ExifService _exifService;

public Service2(ExtendedGooglePhotosService extendedGooglePhotosService, ILogger<Service2> logger, VideosDatabase videosDatabase, Service3 service3, VideosDatabaseOperations videosDatabaseOperations)
public Service2(ExtendedGooglePhotosService extendedGooglePhotosService, ILogger<Service2> logger, VideosDatabase videosDatabase, ExifService exifService, VideosDatabaseOperations videosDatabaseOperations)
{
_extendedGooglePhotosService = extendedGooglePhotosService;
_logger = logger;
_videosDatabase = videosDatabase;
_service3 = service3;
_exifService = exifService;
_videosDatabaseOperations = videosDatabaseOperations;
}

Expand Down Expand Up @@ -89,7 +89,7 @@ public async Task UploadPhotos(List<(long chatId, int messageId, string path, Da

Directory.CreateDirectory(tempDirectory);
var tempFileName = Path.Combine(Path.GetTempPath(), i.ToString(), Path.GetFileName(itemsByKey[x].path));
var timestampFromFile = await _service3.SetExifTimestamp(itemsByKey[x].path, tempFileName);
var timestampFromFile = await _exifService.SetExifTimestamp(itemsByKey[x].path, tempFileName);
lock (fileNameTimestamps)
{
fileNameTimestamps[x] = timestampFromFile;
Expand Down

0 comments on commit 12d6bf9

Please sign in to comment.