mirror of
https://github.com/Radarr/Radarr
synced 2026-01-25 00:41:50 +01:00
refactor: add IMediaResource interface for resource mapping consolidation (#143)
Create common interface for media resource properties (Id, Monitored, QualityProfileId, Path, RootFolderPath, Added, Tags). BookResource, AudiobookResource, and AuthorResource now implement IMediaResource. Foundation for future resource mapping consolidation. Co-authored-by: admin <admin@ardentleatherworks.com>
This commit is contained in:
parent
a567eb870d
commit
18f5ad5ee6
4 changed files with 22 additions and 3 deletions
|
|
@ -2,11 +2,12 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using NzbDrone.Core.Audiobooks;
|
||||
using Radarr.Api.V3.MediaItems;
|
||||
using Radarr.Http.REST;
|
||||
|
||||
namespace Radarr.Api.V3.Audiobooks
|
||||
{
|
||||
public class AudiobookResource : RestResource
|
||||
public class AudiobookResource : RestResource, IMediaResource
|
||||
{
|
||||
public AudiobookResource()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,11 +2,12 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using NzbDrone.Core.Authors;
|
||||
using Radarr.Api.V3.MediaItems;
|
||||
using Radarr.Http.REST;
|
||||
|
||||
namespace Radarr.Api.V3.Authors
|
||||
{
|
||||
public class AuthorResource : RestResource
|
||||
public class AuthorResource : RestResource, IMediaResource
|
||||
{
|
||||
public AuthorResource()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,11 +2,12 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using NzbDrone.Core.Books;
|
||||
using Radarr.Api.V3.MediaItems;
|
||||
using Radarr.Http.REST;
|
||||
|
||||
namespace Radarr.Api.V3.Books
|
||||
{
|
||||
public class BookResource : RestResource
|
||||
public class BookResource : RestResource, IMediaResource
|
||||
{
|
||||
public BookResource()
|
||||
{
|
||||
|
|
|
|||
16
src/Radarr.Api.V3/MediaItems/IMediaResource.cs
Normal file
16
src/Radarr.Api.V3/MediaItems/IMediaResource.cs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Radarr.Api.V3.MediaItems
|
||||
{
|
||||
public interface IMediaResource
|
||||
{
|
||||
int Id { get; set; }
|
||||
bool Monitored { get; set; }
|
||||
int QualityProfileId { get; set; }
|
||||
string Path { get; set; }
|
||||
string RootFolderPath { get; set; }
|
||||
DateTime Added { get; set; }
|
||||
HashSet<int> Tags { get; set; }
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue