diff --git a/VOffline/Services/Storage/FilesystemTools.cs b/VOffline/Services/Storage/FilesystemTools.cs index 6cd2ffc..01e564c 100644 --- a/VOffline/Services/Storage/FilesystemTools.cs +++ b/VOffline/Services/Storage/FilesystemTools.cs @@ -27,6 +27,11 @@ namespace VOffline.Services.Storage RootDir = MkDir(settings.Value.OutputPath); cacheFile = new FileInfo(CombineCutPath(RootDir, CacheFilename)); cache = new ConcurrentDictionary(); + + if (!cacheFile.Exists) + { + cacheFile.Create()?.Dispose(); + } } public void LoadCache(ILog log) diff --git a/VOffline/Services/Vk/AttachmentExtensions.cs b/VOffline/Services/Vk/AttachmentExtensions.cs index 786dab2..80841dc 100644 --- a/VOffline/Services/Vk/AttachmentExtensions.cs +++ b/VOffline/Services/Vk/AttachmentExtensions.cs @@ -94,7 +94,9 @@ namespace VOffline.Services.Vk } else { - log.Warn($"Video {video.Id} [{video.Title}] has no links"); + log.Warn($"Video {video.Id} [{video.Title}] has no links. Trying to compose vk url"); + var file = filesystemTools.CreateFile(dir, $"{i} {video.Id}.txt", CreateMode.OverwriteExisting); + File.WriteAllText(file.FullName, $"https://vk.com/video{video.OwnerId}_{video.Id}"); } } @@ -201,6 +203,7 @@ namespace VOffline.Services.Vk { sb.Append($", reply to user {comment.ReplyToUserId} comment {comment.ReplyToCommentId}"); } + return sb.ToString(); } diff --git a/VOffline/VOffline.csproj b/VOffline/VOffline.csproj index 9a74614..074befc 100644 --- a/VOffline/VOffline.csproj +++ b/VOffline/VOffline.csproj @@ -3,8 +3,9 @@ Exe netcoreapp2.1 - 26938AF3-7336-429C-A3AF-2D3048ACB226 latest + VOffline + 93680df2-87fc-4326-b623-001d5725f6ae