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:
Cody Kickertz 2025-12-23 12:58:39 -06:00 committed by GitHub
parent a567eb870d
commit 18f5ad5ee6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 22 additions and 3 deletions

View file

@ -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()
{

View file

@ -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()
{

View file

@ -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()
{

View 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; }
}
}