-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Updated the SignalR Connection Manager to support both the new and old signalr events.
- Loading branch information
Showing
9 changed files
with
239 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
using System.Collections.Generic; | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Shokofin.SignalR.Interfaces; | ||
|
||
public interface IFileEventArgs | ||
{ | ||
/// <summary> | ||
/// Shoko file id. | ||
/// </summary> | ||
int FileId { get; } | ||
|
||
/// <summary> | ||
/// The ID of the new import folder the event was detected in. | ||
/// </summary> | ||
/// <value></value> | ||
int ImportFolderId { get; } | ||
|
||
/// <summary> | ||
/// The relative path of the new file from the import folder base location. | ||
/// </summary> | ||
string RelativePath { get; } | ||
|
||
/// <summary> | ||
/// Cross references of episodes linked to this file. | ||
/// </summary> | ||
List<FileCrossReference> CrossReferences { get; } | ||
|
||
public class FileCrossReference | ||
{ | ||
/// <summary> | ||
/// Shoko episode id. | ||
/// </summary> | ||
[JsonPropertyName("EpisodeID")] | ||
public int EpisodeId { get; set; } | ||
|
||
/// <summary> | ||
/// Shoko series id. | ||
/// </summary> | ||
[JsonPropertyName("SeriesID")] | ||
public int SeriesId { get; set; } | ||
|
||
/// <summary> | ||
/// Shoko group id. | ||
/// </summary> | ||
[JsonPropertyName("GroupID")] | ||
public int GroupId { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,47 @@ | ||
using System.Collections.Generic; | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Shokofin.SignalR.Models; | ||
|
||
public class EpisodeInfoUpdatedEventArgs | ||
{ | ||
/// <summary> | ||
/// Shoko episode id. | ||
/// The update reason. | ||
/// </summary> | ||
public UpdateReason Reason { get; set; } | ||
/// <summary> | ||
/// The provider metadata source. | ||
/// </summary> | ||
[JsonPropertyName("Source")] | ||
public string ProviderName { get; set; } = string.Empty; | ||
|
||
/// <summary> | ||
/// The provided metadata episode id. | ||
/// </summary> | ||
[JsonPropertyName("EpisodeID")] | ||
public int EpisodeId { get; set; } | ||
public int ProviderId { get; set; } | ||
|
||
/// <summary> | ||
/// Shoko series id. | ||
/// The provided metadata series id. | ||
/// </summary> | ||
[JsonPropertyName("SeriesID")] | ||
public int SeriesId { get; set; } | ||
public int ProviderSeriesId { get; set; } | ||
|
||
/// <summary> | ||
/// Shoko episode ids affected by this update. | ||
/// </summary> | ||
[JsonPropertyName("ShokoEpisodeIDs")] | ||
public List<int> EpisodeIds { get; set; } = new(); | ||
|
||
/// <summary> | ||
/// Shoko series ids affected by this update. | ||
/// </summary> | ||
[JsonPropertyName("ShokoSeriesIDs")] | ||
public List<int> SeriesIds { get; set; } = new(); | ||
|
||
/// <summary> | ||
/// Shoko group id. | ||
/// Shoko group ids affected by this update. | ||
/// </summary> | ||
[JsonPropertyName("GroupID")] | ||
public int GroupId { get; set; } | ||
[JsonPropertyName("ShokoGroupIDs")] | ||
public List<int> GroupIds { get; set; } = new(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,33 @@ | ||
using System.Collections.Generic; | ||
using System.Text.Json.Serialization; | ||
using Shokofin.SignalR.Interfaces; | ||
|
||
namespace Shokofin.SignalR.Models; | ||
|
||
public class FileMatchedEventArgs : FileEventArgs | ||
public class FileMatchedEventArgsV1 : IFileEventArgs | ||
{ | ||
/// <summary> | ||
/// Cross references of episodes linked to this file. | ||
/// Shoko file id. | ||
/// </summary> | ||
[JsonPropertyName("CrossRefs")] | ||
public List<FileCrossReference> CrossReferences { get; set; } = new(); | ||
[JsonPropertyName("FileID")] | ||
public int FileId { get; set; } | ||
|
||
public class FileCrossReference | ||
{ | ||
/// <summary> | ||
/// Shoko episode id. | ||
/// </summary> | ||
[JsonPropertyName("EpisodeID")] | ||
public int EpisodeId { get; set; } | ||
/// <summary> | ||
/// The ID of the import folder the event was detected in. | ||
/// </summary> | ||
/// <value></value> | ||
[JsonPropertyName("ImportFolderID")] | ||
public int ImportFolderId { get; set; } | ||
|
||
/// <summary> | ||
/// Shoko series id. | ||
/// </summary> | ||
[JsonPropertyName("SeriesID")] | ||
public int SeriesId { get; set; } | ||
/// <summary> | ||
/// The relative path of the file from the import folder base location. | ||
/// </summary> | ||
[JsonPropertyName("RelativePath")] | ||
public string RelativePath { get; set; } = string.Empty; | ||
|
||
/// <summary> | ||
/// Shoko group id. | ||
/// </summary> | ||
[JsonPropertyName("GroupID")] | ||
public int GroupId { get; set; } | ||
} | ||
/// <summary> | ||
/// Cross references of episodes linked to this file. | ||
/// </summary> | ||
[JsonPropertyName("CrossRefs")] | ||
public List<IFileEventArgs.FileCrossReference> CrossReferences { get; set; } = new(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,36 @@ | ||
using System.Collections.Generic; | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Shokofin.SignalR.Models; | ||
|
||
public class SeriesInfoUpdatedEventArgs | ||
{ | ||
/// <summary> | ||
/// Shoko series id. | ||
/// The update reason. | ||
/// </summary> | ||
public UpdateReason Reason { get; set; } | ||
|
||
/// <summary> | ||
/// The provider metadata source. | ||
/// </summary> | ||
[JsonPropertyName("Source")] | ||
public string ProviderName { get; set; } = string.Empty; | ||
|
||
/// <summary> | ||
/// The provided metadata series id. | ||
/// </summary> | ||
[JsonPropertyName("SeriesID")] | ||
public int SeriesId { get; set; } | ||
public int ProviderId { get; set; } | ||
|
||
/// <summary> | ||
/// Shoko series ids affected by this update. | ||
/// </summary> | ||
[JsonPropertyName("ShokoSeriesIDs")] | ||
public List<int> SeriesIds { get; set; } = new(); | ||
|
||
/// <summary> | ||
/// Shoko group id. | ||
/// Shoko group ids affected by this update. | ||
/// </summary> | ||
[JsonPropertyName("GroupID")] | ||
public int GroupId { get; set; } | ||
[JsonPropertyName("ShokoGroupIDs")] | ||
public List<int> GroupIds { get; set; } = new(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
using System.Text.Json.Serialization; | ||
|
||
namespace Shokofin.SignalR.Models; | ||
|
||
[JsonConverter(typeof(JsonStringEnumConverter))] | ||
public enum UpdateReason | ||
{ | ||
None = 0, | ||
Added = 1, | ||
Updated = 2, | ||
Removed = 3, | ||
} |
Oops, something went wrong.