Compare commits
2 Commits
1fe4b75ac7
...
4f4b0cb3a8
Author | SHA1 | Date | |
---|---|---|---|
4f4b0cb3a8 | |||
48d312da0b |
@ -1,5 +1,6 @@
|
||||
using System.Net;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Text.RegularExpressions;
|
||||
using Logging;
|
||||
|
||||
namespace Tranga.LibraryConnectors;
|
||||
@ -20,7 +21,10 @@ public abstract class LibraryConnector : GlobalBase
|
||||
|
||||
protected LibraryConnector(GlobalBase clone, string baseUrl, string auth, LibraryType libraryType) : base(clone)
|
||||
{
|
||||
this.baseUrl = baseUrl;
|
||||
Regex urlRex = new(@"https?:\/\/[0-9A-z\.]*");
|
||||
if (!urlRex.IsMatch(baseUrl))
|
||||
throw new ArgumentException("Base url does not match pattern");
|
||||
this.baseUrl = urlRex.Match(baseUrl).Value;
|
||||
this.auth = auth;
|
||||
this.libraryType = libraryType;
|
||||
}
|
||||
|
@ -162,7 +162,7 @@ public abstract class MangaConnector : GlobalBase
|
||||
Log($"Cloning cover {fileInCache} -> {newFilePath}");
|
||||
File.Copy(fileInCache, newFilePath, true);
|
||||
if(RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
|
||||
File.SetUnixFileMode(newFilePath, GroupRead | GroupWrite | OtherRead | OtherWrite | UserRead | UserWrite);
|
||||
File.SetUnixFileMode(newFilePath, GroupRead | GroupWrite | UserRead | UserWrite);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
Loading…
Reference in New Issue
Block a user