Your ROOT_URL in app.ini is https://git.cloudchain.link/ but you are visiting https://dash.bss.nz/open-source-mirrors/Prowlarr/blame/commit/7c72e1e865edcb0d6cbc420a6636210fd0b0c8d3/NzbDrone.Core/MediaFiles/MediaFileRepository.cs You should set ROOT_URL correctly, otherwise the web may not work correctly.
Prowlarr/NzbDrone.Core/MediaFiles/MediaFileRepository.cs

46 lines
1.4 KiB

using System.Collections.Generic;
using System.Linq;
using NzbDrone.Common.Messaging;
using NzbDrone.Core.Datastore;
namespace NzbDrone.Core.MediaFiles
{
public interface IMediaFileRepository : IBasicRepository<EpisodeFile>
{
EpisodeFile GetFileByPath(string path);
List<EpisodeFile> GetFilesBySeries(int seriesId);
List<EpisodeFile> GetFilesBySeason(int seriesId, int seasonNumber);
bool Exists(string path);
}
public class MediaFileRepository : BasicRepository<EpisodeFile>, IMediaFileRepository
{
public MediaFileRepository(IDatabase database, IMessageAggregator messageAggregator)
: base(database, messageAggregator)
{
}
public EpisodeFile GetFileByPath(string path)
{
return Query.SingleOrDefault(c => c.Path == path);
}
public List<EpisodeFile> GetFilesBySeries(int seriesId)
{
return Query.Where(c => c.SeriesId == seriesId).ToList();
}
public List<EpisodeFile> GetFilesBySeason(int seriesId, int seasonNumber)
{
return Query.Where(c => c.SeriesId == seriesId)
.AndWhere(c => c.SeasonNumber == seasonNumber)
.ToList();
}
public bool Exists(string path)
{
return Query.Any(c => c.Path == path);
}
}
}