1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-10-30 15:32:31 +01:00

Merge branch 'markus101'

Conflicts:
	NzbDrone.Web/NzbDrone.Web.Publish.xml
This commit is contained in:
kay.one 2011-04-24 20:53:04 -07:00
commit 623857eb90
15 changed files with 62 additions and 39 deletions

View File

@ -145,7 +145,7 @@
<virtualDirectory path="/" physicalPath="%NZBDRONE_PATH%\NZBDrone.Web" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:1362:" />
<binding protocol="http" bindingInformation="*:8989:" />
</bindings>
</site>
<siteDefaults>

View File

@ -69,8 +69,8 @@ namespace NzbDrone.Core.Test
public class MockIndexerProvider : IndexerProviderBase
{
public MockIndexerProvider(SeriesProvider seriesProvider, SeasonProvider seasonProvider, EpisodeProvider episodeProvider, ConfigProvider configProvider, HttpProvider httpProvider, IndexerProvider indexerProvider, HistoryProvider historyProvider)
: base(seriesProvider, seasonProvider, episodeProvider, configProvider, httpProvider, indexerProvider, historyProvider)
public MockIndexerProvider(SeriesProvider seriesProvider, SeasonProvider seasonProvider, EpisodeProvider episodeProvider, ConfigProvider configProvider, HttpProvider httpProvider, IndexerProvider indexerProvider, HistoryProvider historyProvider, SabProvider sabProvider)
: base(seriesProvider, seasonProvider, episodeProvider, configProvider, httpProvider, indexerProvider, historyProvider, sabProvider)
{
}

View File

@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.ServiceModel.Syndication;
using NLog;
@ -18,11 +19,12 @@ namespace NzbDrone.Core.Providers.Indexer
private readonly HistoryProvider _historyProvider;
protected readonly SeasonProvider _seasonProvider;
protected readonly SeriesProvider _seriesProvider;
protected readonly SabProvider _sabProvider;
protected IndexerProviderBase(SeriesProvider seriesProvider, SeasonProvider seasonProvider,
EpisodeProvider episodeProvider, ConfigProvider configProvider,
HttpProvider httpProvider, IndexerProvider indexerProvider, HistoryProvider historyProvider)
HttpProvider httpProvider, IndexerProvider indexerProvider,
HistoryProvider historyProvider, SabProvider sabProvider)
{
_seriesProvider = seriesProvider;
_seasonProvider = seasonProvider;
@ -31,6 +33,7 @@ namespace NzbDrone.Core.Providers.Indexer
_httpProvider = httpProvider;
_indexerProvider = indexerProvider;
_historyProvider = historyProvider;
_sabProvider = sabProvider;
_logger = LogManager.GetLogger(GetType().ToString());
}
@ -123,25 +126,33 @@ namespace NzbDrone.Core.Providers.Indexer
var episodes = _episodeProvider.GetEpisodeByParseResult(parseResult);
if (InHistory(episodes, parseResult, feedItem))
{
return;
}
var sabTitle = _sabProvider.GetSabTitle(parseResult);
if (_sabProvider.IsInQueue(sabTitle))
{
return;
}
if (!_sabProvider.AddByUrl(NzbDownloadUrl(feedItem), sabTitle))
{
return;
}
foreach (var episode in episodes)
{
if (_historyProvider.Exists(episode.EpisodeId, parseResult.Quality, parseResult.Proper))
_historyProvider.Add(new History
{
_logger.Debug("Episode in history: {0}", feedItem.Title.Text);
}
else
{
//TODO: Add episode to sab
_historyProvider.Add(new History
{
Date = DateTime.Now,
EpisodeId = episode.EpisodeId,
IsProper = parseResult.Proper,
NzbTitle = feedItem.Title.Text,
Quality = parseResult.Quality
});
}
Date = DateTime.Now,
EpisodeId = episode.EpisodeId,
IsProper = parseResult.Proper,
NzbTitle = feedItem.Title.Text,
Quality = parseResult.Quality
});
}
}
}
@ -188,5 +199,18 @@ namespace NzbDrone.Core.Providers.Indexer
/// <param name = "item">RSS Feed item to generate the link for</param>
/// <returns>Download link URL</returns>
protected abstract string NzbDownloadUrl(SyndicationItem item);
private bool InHistory(IList<Episode> episodes, EpisodeParseResult parseResult, SyndicationItem feedItem)
{
foreach (var episode in episodes)
{
if (_historyProvider.Exists(episode.EpisodeId, parseResult.Quality, parseResult.Proper))
{
_logger.Debug("Episode in history: {0}", feedItem.Title.Text);
return true;
}
}
return false;
}
}
}

View File

@ -7,7 +7,7 @@ namespace NzbDrone.Core.Providers.Indexer
{
public class NewzbinProvider : IndexerProviderBase
{
public NewzbinProvider(SeriesProvider seriesProvider, SeasonProvider seasonProvider, EpisodeProvider episodeProvider, ConfigProvider configProvider, HttpProvider httpProvider, IndexerProvider indexerProvider, HistoryProvider historyProvider) : base(seriesProvider, seasonProvider, episodeProvider, configProvider, httpProvider, indexerProvider, historyProvider)
public NewzbinProvider(SeriesProvider seriesProvider, SeasonProvider seasonProvider, EpisodeProvider episodeProvider, ConfigProvider configProvider, HttpProvider httpProvider, IndexerProvider indexerProvider, HistoryProvider historyProvider, SabProvider sabProvider) : base(seriesProvider, seasonProvider, episodeProvider, configProvider, httpProvider, indexerProvider, historyProvider, sabProvider)
{
}

View File

@ -6,7 +6,7 @@ namespace NzbDrone.Core.Providers.Indexer
{
public class NzbMatrixProvider : IndexerProviderBase
{
public NzbMatrixProvider(SeriesProvider seriesProvider, SeasonProvider seasonProvider, EpisodeProvider episodeProvider, ConfigProvider configProvider, HttpProvider httpProvider, IndexerProvider indexerProvider, HistoryProvider historyProvider) : base(seriesProvider, seasonProvider, episodeProvider, configProvider, httpProvider, indexerProvider, historyProvider)
public NzbMatrixProvider(SeriesProvider seriesProvider, SeasonProvider seasonProvider, EpisodeProvider episodeProvider, ConfigProvider configProvider, HttpProvider httpProvider, IndexerProvider indexerProvider, HistoryProvider historyProvider, SabProvider sabProvider) : base(seriesProvider, seasonProvider, episodeProvider, configProvider, httpProvider, indexerProvider, historyProvider, sabProvider)
{
}

View File

@ -6,7 +6,7 @@ namespace NzbDrone.Core.Providers.Indexer
{
public class NzbsOrgProvider : IndexerProviderBase
{
public NzbsOrgProvider(SeriesProvider seriesProvider, SeasonProvider seasonProvider, EpisodeProvider episodeProvider, ConfigProvider configProvider, HttpProvider httpProvider, IndexerProvider indexerProvider, HistoryProvider historyProvider) : base(seriesProvider, seasonProvider, episodeProvider, configProvider, httpProvider, indexerProvider, historyProvider)
public NzbsOrgProvider(SeriesProvider seriesProvider, SeasonProvider seasonProvider, EpisodeProvider episodeProvider, ConfigProvider configProvider, HttpProvider httpProvider, IndexerProvider indexerProvider, HistoryProvider historyProvider, SabProvider sabProvider) : base(seriesProvider, seasonProvider, episodeProvider, configProvider, httpProvider, indexerProvider, historyProvider, sabProvider)
{
}

View File

@ -6,7 +6,7 @@ namespace NzbDrone.Core.Providers.Indexer
{
public class NzbsRUsProvider : IndexerProviderBase
{
public NzbsRUsProvider(SeriesProvider seriesProvider, SeasonProvider seasonProvider, EpisodeProvider episodeProvider, ConfigProvider configProvider, HttpProvider httpProvider, IndexerProvider indexerProvider, HistoryProvider historyProvider) : base(seriesProvider, seasonProvider, episodeProvider, configProvider, httpProvider, indexerProvider, historyProvider)
public NzbsRUsProvider(SeriesProvider seriesProvider, SeasonProvider seasonProvider, EpisodeProvider episodeProvider, ConfigProvider configProvider, HttpProvider httpProvider, IndexerProvider indexerProvider, HistoryProvider historyProvider, SabProvider sabProvider) : base(seriesProvider, seasonProvider, episodeProvider, configProvider, httpProvider, indexerProvider, historyProvider, sabProvider)
{
}

View File

@ -84,7 +84,7 @@ namespace NzbDrone.Web.Controllers
ViewData["guid"] = Guid.NewGuid();
ViewData["path"] = path;
ViewData["javaPath"] = path.Replace(Path.DirectorySeparatorChar, '|').Replace(Path.VolumeSeparatorChar, '^');
ViewData["javaPath"] = path.Replace(Path.DirectorySeparatorChar, '|').Replace(Path.VolumeSeparatorChar, '^').Replace('\'', '`');
var defaultQuality = _configProvider.DefaultQualityProfile;
var qualityProfiles = _qualityProvider.GetAllProfiles();
@ -105,7 +105,7 @@ namespace NzbDrone.Web.Controllers
//Add the new series to the Database
_seriesProvider.AddSeries(
path.Replace('|', Path.DirectorySeparatorChar).Replace('^', Path.VolumeSeparatorChar), seriesId,
path.Replace('|', Path.DirectorySeparatorChar).Replace('^', Path.VolumeSeparatorChar).Replace('`', '\''), seriesId,
qualityProfileId);
ScanNewSeries();
return new JsonResult { Data = "ok" };

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<publishData>
<publishProfile publishUrl="C:\Users\keivan.beigi\Desktop\D\" deleteExistingFiles="True" ftpAnonymousLogin="False" ftpPassiveMode="True" msdeploySite="" msdeploySiteID="" msdeployRemoteSitePhysicalPath="" msdeployAllowUntrustedCertificate="False" msdeploySkipExtraFilesOnServer="True" msdeployMarkAsApp="False" profileName="Profile1" publishMethod="FileSystem" replaceMatchingFiles="False" userName="" savePWD="False" userPWD="" SelectedForPublish="False">
<file relUrl="Views/Series/Unmapped.aspx" publishTime="10/04/2010 22:53:21" />

View File

@ -590,6 +590,7 @@
<Content Include="Content\notibar.css" />
<Content Include="Content\style.css" />
<Content Include="Content\XbmcNotification.png" />
<Content Include="favicon.ico" />
<Content Include="Global.asax" />
<Content Include="Libraries\Ninject.Web.Mvc.dll" />
<Content Include="Libraries\Ninject.Web.Mvc.xml" />
@ -633,7 +634,7 @@
<Content Include="Scripts\Notification.js" />
<Content Include="Views\AddSeries\AddExisting.cshtml" />
<Content Include="Views\AddSeries\AddNew.cshtml" />
<None Include="Views\AddSeries\AddSeriesItem.cshtml" />
<Content Include="Views\AddSeries\AddSeriesItem.cshtml" />
<Content Include="Web.config">
<SubType>Designer</SubType>
</Content>

View File

@ -76,17 +76,11 @@
return false;
});
// $("a.deleteRow").live("click", function () {
// $(this).parents("div.userProfileSectionEditor:first").remove();
// return false;
// });
var deleteQualityProfileUrl = '@Url.Action("DeleteQualityProfile", "Settings")';
function deleteProfile(id) {
//$(this).parents("div.userProfileSectionEditor:first").remove();
sendToServer(id);
$("#div_" + id).hide();
$("#div_" + id).remove();
}
function sendToServer(id) {
@ -95,7 +89,7 @@
url: deleteQualityProfileUrl,
data: jQuery.param({ profileId: id }),
error: function (req, status, error) {
alert("Sorry! We could not add " + path + " at this time. " + error);
alert("Sorry! We could not delete your Profile at this time. " + error);
}
});
}

View File

@ -35,7 +35,7 @@ namespace NzbDrone
IISProcess = new Process();
IISProcess.StartInfo.FileName = IISExe;
IISProcess.StartInfo.Arguments = String.Format("/config:{0} /trace:i", IISConfigPath);//"/config:"""" /trace:i";
IISProcess.StartInfo.Arguments = String.Format("/config:\"{0}\" /trace:i", IISConfigPath);//"/config:"""" /trace:i";
IISProcess.StartInfo.WorkingDirectory = Config.ProjectRoot;
IISProcess.StartInfo.UseShellExecute = false;

View File

@ -49,6 +49,9 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>NzbDrone.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="Accessibility">
<EmbedInteropTypes>True</EmbedInteropTypes>
@ -88,6 +91,7 @@
</ItemGroup>
<ItemGroup>
<Content Include="Microsoft.Web.Administration.dll" />
<Content Include="NzbDrone.ico" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.0">

BIN
NzbDrone/NzbDrone.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

View File

@ -4,6 +4,6 @@
<supportedRuntime version="v4.0" />
</startup>
<appSettings>
<add key="port" value="1362" />
<add key="port" value="8989" />
</appSettings>
</configuration>