[WIP] Additions to custom formats, such as rescanning old files. (#2949)

This commit is contained in:
Leonardo Galli
2018-09-10 21:25:10 +02:00
committed by GitHub
parent 1059e145c3
commit b4f456d5f0
65 changed files with 1322 additions and 3766 deletions

View File

@@ -49,4 +49,20 @@ namespace NzbDrone.Core.CustomFormats
return (Id != null ? Id.GetHashCode() : 0);
}
}
public static class CustomFormatExtensions
{
public static string ToExtendedString(this IEnumerable<CustomFormat> formats)
{
return string.Join(", ", formats.Select(f => f.ToString()));
}
public static List<CustomFormat> WithNone(this IEnumerable<CustomFormat> formats)
{
var list = formats.ToList();
if (list.Any()) return list;
return new List<CustomFormat>{CustomFormat.None};
}
}
}