mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Added: Ability to add custom formats, working similar to qualities. (#2669)
Originally called project metis, this feature allows you to do a lot of cool stuff, such as upgrading to a x265 encode, downloading releases with multiple languages, etc. Check out the wiki page at: https://github.com/Radarr/Radarr/wiki/Custom-Formats to learn more! Note: This feature is currently in "beta" and will get more tags and features in the future. Please let me know, if you have any issues and I hope this will allow for a lot of customization!
This commit is contained in:
52
src/NzbDrone.Core/CustomFormats/CustomFormat.cs
Normal file
52
src/NzbDrone.Core/CustomFormats/CustomFormat.cs
Normal file
@@ -0,0 +1,52 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using NzbDrone.Core.Datastore;
|
||||
|
||||
namespace NzbDrone.Core.CustomFormats
|
||||
{
|
||||
public class CustomFormat : ModelBase, IEquatable<CustomFormat>
|
||||
{
|
||||
public CustomFormat()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public CustomFormat(string name, params string[] tags)
|
||||
{
|
||||
Name = name;
|
||||
FormatTags = tags.Select(t => new FormatTag(t)).ToList();
|
||||
}
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
public List<FormatTag> FormatTags { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Name;
|
||||
}
|
||||
|
||||
public static CustomFormat None => new CustomFormat("None");
|
||||
|
||||
public bool Equals(CustomFormat other)
|
||||
{
|
||||
if (ReferenceEquals(null, other)) return false;
|
||||
if (ReferenceEquals(this, other)) return true;
|
||||
return int.Equals(Id, other.Id);
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (ReferenceEquals(null, obj)) return false;
|
||||
if (ReferenceEquals(this, obj)) return true;
|
||||
if (obj.GetType() != this.GetType()) return false;
|
||||
return Equals((CustomFormat) obj);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return (Id != null ? Id.GetHashCode() : 0);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user