Skip to content

Commit

Permalink
fix: filter name should be optional
Browse files Browse the repository at this point in the history
  • Loading branch information
revam committed Dec 4, 2023
1 parent c73f085 commit a286b58
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Shoko.Server/API/v3/Helpers/FilterFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ public FilterPreset GetFilterPreset(Filter.Input.CreateOrUpdateFilterBody filter

existing.ParentFilterPresetID = filter.ParentID;
existing.FilterType = filter.IsDirectory ? GroupFilterType.UserDefined | GroupFilterType.Directory : GroupFilterType.UserDefined;
existing.Name = filter.Name;
existing.Name = filter.Name ?? string.Empty;
existing.Hidden = filter.IsHidden;
existing.ApplyAtSeriesLevel = filter.ApplyAtSeriesLevel;
if (!filter.IsDirectory)
Expand Down
3 changes: 1 addition & 2 deletions Shoko.Server/API/v3/Models/Shoko/Filter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,7 @@ public class CreateOrUpdateFilterBody
/// <summary>
/// The filter name.
/// </summary>
/// <value></value>
public string Name { get; set; } = string.Empty;
public string? Name { get; set; }

/// <summary>
/// The id of the parent filter. If you want to add/move this filter
Expand Down

0 comments on commit a286b58

Please sign in to comment.