mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2026-10-25 12:10:56 -04:00
Added many more braces for multiline if's, Improved .crypto command quite a bit and applied locale-specific format
This commit is contained in:
@@ -15,9 +15,12 @@ public class ImageCacherObject : IComparable<ImageCacherObject>
|
||||
if (type == Booru.Danbooru && !Uri.IsWellFormedUriString(obj.FileUrl, UriKind.Absolute))
|
||||
FileUrl = "https://danbooru.donmai.us" + obj.FileUrl;
|
||||
else
|
||||
{
|
||||
FileUrl = obj.FileUrl.StartsWith("http", StringComparison.InvariantCulture)
|
||||
? obj.FileUrl
|
||||
: "https:" + obj.FileUrl;
|
||||
}
|
||||
|
||||
SearchType = type;
|
||||
Rating = obj.Rating;
|
||||
Tags = new((obj.Tags ?? obj.TagString).Split(' '));
|
||||
|
||||
@@ -46,8 +46,10 @@ public class NotifChecker
|
||||
.ToList();
|
||||
|
||||
if (remove)
|
||||
{
|
||||
foreach (var toBeRemoved in toReturn)
|
||||
_streamProviders[toBeRemoved.Type].ClearErrorsFor(toBeRemoved.Name);
|
||||
}
|
||||
|
||||
return toReturn;
|
||||
}
|
||||
@@ -74,9 +76,11 @@ public class NotifChecker
|
||||
// get all stream data for the streams of this type
|
||||
if (_streamProviders.TryGetValue(x.Key,
|
||||
out var provider))
|
||||
{
|
||||
return provider.GetStreamDataAsync(x.Value
|
||||
.Select(entry => entry.Key)
|
||||
.ToList());
|
||||
}
|
||||
|
||||
// this means there's no provider for this stream data, (and there was before?)
|
||||
return Task.FromResult<IReadOnlyCollection<StreamData>>(
|
||||
@@ -111,9 +115,7 @@ public class NotifChecker
|
||||
// before it sends an offline notification to the subscribers.
|
||||
var streamId = (key.Type, key.Name);
|
||||
if (!newData.IsLive && _offlineBuffer.Remove(streamId))
|
||||
{
|
||||
newlyOffline.Add(newData);
|
||||
}
|
||||
else if (newData.IsLive != oldData.IsLive)
|
||||
{
|
||||
if (newData.IsLive)
|
||||
|
||||
Reference in New Issue
Block a user