Skip to content

Commit

Permalink
chore: flatten namespaces and enable nullable
Browse files Browse the repository at this point in the history
on some files
  • Loading branch information
revam committed Mar 29, 2024
1 parent 2db2b53 commit 09e7342
Show file tree
Hide file tree
Showing 16 changed files with 2,003 additions and 2,026 deletions.
8 changes: 7 additions & 1 deletion Shokofin/API/Info/ShowInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,13 @@ public class ShowInfo
/// <summary>
/// Overall content rating of the show.
/// </summary>
public string? ContentRating =>
public string? OfficialRating =>
DefaultSeason.AniDB.Restricted ? "XXX" : null;

/// <summary>
/// Custom rating of the show.
/// </summary>
public string? CustomRating =>
DefaultSeason.AniDB.Restricted ? "XXX" : null;

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion Shokofin/API/Models/Episode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public class AniDB

public string Description { get; set; } = "";

public Rating? Rating { get; set; } = new();
public Rating Rating { get; set; } = new();
}

public class TvDB
Expand Down
126 changes: 63 additions & 63 deletions Shokofin/Configuration/UserConfiguration.cs
Original file line number Diff line number Diff line change
@@ -1,80 +1,80 @@
using System;
using System.ComponentModel.DataAnnotations;

namespace Shokofin.Configuration
#nullable enable
namespace Shokofin.Configuration;

/// <summary>
/// Per user configuration.
/// </summary>
public class UserConfiguration
{
/// <summary>
/// Per user configuration.
/// The Jellyfin user id this configuration is for.
/// </summary>
public Guid UserId { get; set; } = Guid.Empty;

/// <summary>
/// Enables watch-state synchronization for the user.
/// </summary>
public class UserConfiguration
{
/// <summary>
/// The Jellyfin user id this configuration is for.
/// </summary>
public Guid UserId { get; set; } = Guid.Empty;
public bool EnableSynchronization { get; set; }

/// <summary>
/// Enables watch-state synchronization for the user.
/// </summary>
public bool EnableSynchronization { get; set; }
/// <summary>
/// Enable the stop event for syncing after video playback.
/// </summary>
public bool SyncUserDataAfterPlayback { get; set; }

/// <summary>
/// Enable the stop event for syncing after video playback.
/// </summary>
public bool SyncUserDataAfterPlayback { get; set; }

/// <summary>
/// Enable the play/pause/resume(/stop) events for syncing under/during
/// video playback.
/// </summary>
public bool SyncUserDataUnderPlayback { get; set; }
/// <summary>
/// Enable the play/pause/resume(/stop) events for syncing under/during
/// video playback.
/// </summary>
public bool SyncUserDataUnderPlayback { get; set; }

/// <summary>
/// Enable the scrobble event for live syncing under/during video
/// playback.
/// </summary>
public bool SyncUserDataUnderPlaybackLive { get; set; }
/// <summary>
/// Enable the scrobble event for live syncing under/during video
/// playback.
/// </summary>
public bool SyncUserDataUnderPlaybackLive { get; set; }

/// <summary>
/// Number of playback events to skip before starting to send the events
/// to Shoko. This is to prevent accidentially updating user watch data
/// when a user miss clicked on a video.
/// </summary>
[Range(0, 200)]
public byte SyncUserDataInitialSkipEventCount { get; set; } = 0;
/// <summary>
/// Number of playback events to skip before starting to send the events
/// to Shoko. This is to prevent accidentially updating user watch data
/// when a user miss clicked on a video.
/// </summary>
[Range(0, 200)]
public byte SyncUserDataInitialSkipEventCount { get; set; } = 0;

/// <summary>
/// Number of ticks to skip (1 tick is 10 seconds) before scrobbling to
/// shoko.
/// </summary>
[Range(1, 250)]
public byte SyncUserDataUnderPlaybackAtEveryXTicks { get; set; } = 6;
/// <summary>
/// Number of ticks to skip (1 tick is 10 seconds) before scrobbling to
/// shoko.
/// </summary>
[Range(1, 250)]
public byte SyncUserDataUnderPlaybackAtEveryXTicks { get; set; } = 6;

/// <summary>
/// Imminently scrobble if the playtime changes above this threshold
/// given in ticks (ticks in a time-span).
/// </summary>
/// <value></value>
public long SyncUserDataUnderPlaybackLiveThreshold { get; set; } = 125000000; // 12.5s
/// <summary>
/// Imminently scrobble if the playtime changes above this threshold
/// given in ticks (ticks in a time-span).
/// </summary>
/// <value></value>
public long SyncUserDataUnderPlaybackLiveThreshold { get; set; } = 125000000; // 12.5s

/// <summary>
/// Enable syncing user data when an item have been added/updated.
/// </summary>
public bool SyncUserDataOnImport { get; set; }
/// <summary>
/// Enable syncing user data when an item have been added/updated.
/// </summary>
public bool SyncUserDataOnImport { get; set; }

/// <summary>
/// Enabling user data sync. for restricted videos (H).
/// </summary>
public bool SyncRestrictedVideos { get; set; }
/// <summary>
/// Enabling user data sync. for restricted videos (H).
/// </summary>
public bool SyncRestrictedVideos { get; set; }

/// <summary>
/// The username of the linked user in Shoko.
/// </summary>
public string Username { get; set; } = string.Empty;
/// <summary>
/// The username of the linked user in Shoko.
/// </summary>
public string Username { get; set; } = string.Empty;

/// <summary>
/// The API Token for authentication/authorization with Shoko Server.
/// </summary>
public string Token { get; set; } = string.Empty;
}
/// <summary>
/// The API Token for authentication/authorization with Shoko Server.
/// </summary>
public string Token { get; set; } = string.Empty;
}
Loading

0 comments on commit 09e7342

Please sign in to comment.