some subsonic cleanup

This commit is contained in:
kay.one 2011-04-05 20:14:43 -07:00
parent a28277af61
commit 1e73138f6d
8 changed files with 22 additions and 8 deletions

View File

@ -76,6 +76,7 @@ namespace NzbDrone.Core.Test
var sonicRepo = MockLib.GetEmptyRepository(); var sonicRepo = MockLib.GetEmptyRepository();
var sonicTarget = new SubsonicTarget(sonicRepo); var sonicTarget = new SubsonicTarget(sonicRepo);
LogManager.Configuration.AddTarget("DbLogger", sonicTarget); LogManager.Configuration.AddTarget("DbLogger", sonicTarget);
LogManager.Configuration.LoggingRules.Add(new LoggingRule("*", NLog.LogLevel.Info, sonicTarget)); LogManager.Configuration.LoggingRules.Add(new LoggingRule("*", NLog.LogLevel.Info, sonicTarget));
LogManager.Configuration.Reload(); LogManager.Configuration.Reload();

View File

@ -100,7 +100,12 @@ namespace NzbDrone.Core
{ {
get get
{ {
return HostingEnvironment.ApplicationPhysicalPath; if (!String.IsNullOrWhiteSpace(HostingEnvironment.ApplicationPhysicalPath))
{
return HostingEnvironment.ApplicationPhysicalPath;
}
return Directory.GetCurrentDirectory();
} }
} }

View File

@ -5,28 +5,36 @@ namespace NzbDrone.Core.Instrumentation
{ {
public class Log public class Log
{ {
public int LogId { get; set; } [SubSonicPrimaryKey]
public int LogId { get; protected set; }
[SubSonicLongString] [SubSonicLongString]
public string Message { get; set; } public string Message { get; set; }
public DateTime Time { get; set; } public DateTime Time { get; set; }
public string Logger { get; set; } public string Logger { get; set; }
[SubSonicNullString] [SubSonicNullString]
public string Stack { get; set; } public string Stack { get; set; }
[SubSonicNullString] [SubSonicNullString]
[SubSonicLongString] [SubSonicLongString]
public string ExceptionMessage { get; set; } public string ExceptionMessage { get; set; }
[SubSonicNullString] [SubSonicNullString]
[SubSonicLongString] [SubSonicLongString]
public string ExceptionString { get; set; } public string ExceptionString { get; set; }
[SubSonicNullString] [SubSonicNullString]
public string ExceptionType { get; set; } public string ExceptionType { get; set; }
public LogLevel Level { get; set; } public LogLevel Level { get; set; }
//This is needed for telerik grid binding //This is needed for Telerik grid binding
[SubSonicIgnore] [SubSonicIgnore]
public string DisplayLevel{ public string DisplayLevel
{
get { return Level.ToString(); } get { return Level.ToString(); }
} }
} }

View File

@ -1,5 +1,4 @@
using NzbDrone.Core.Repository.Quality; using NzbDrone.Core.Repository.Quality;
using SubSonic.SqlGeneration.Schema;
namespace NzbDrone.Core.Model namespace NzbDrone.Core.Model
{ {

View File

@ -6,7 +6,7 @@ namespace NzbDrone.Core.Repository
{ {
public class History public class History
{ {
[SubSonicPrimaryKey(true)] [SubSonicPrimaryKey]
public virtual int HistoryId { get; set; } public virtual int HistoryId { get; set; }
public virtual int EpisodeId { get; set; } public virtual int EpisodeId { get; set; }
public virtual int IndexerId { get; set; } public virtual int IndexerId { get; set; }

View File

@ -10,7 +10,7 @@ namespace NzbDrone.Core.Repository
{ {
public class Indexer public class Indexer
{ {
[SubSonicPrimaryKey(false)] [SubSonicPrimaryKey]
public virtual int IndexerId { get; set; } public virtual int IndexerId { get; set; }
public string IndexerName { get; set; } public string IndexerName { get; set; }

View File

@ -8,7 +8,7 @@ namespace NzbDrone.Core.Repository.Quality
{ {
public class QualityProfile public class QualityProfile
{ {
[SubSonicPrimaryKey(true)] [SubSonicPrimaryKey]
public virtual int QualityProfileId { get; set; } public virtual int QualityProfileId { get; set; }
[Required(ErrorMessage = "A Name is Required")] [Required(ErrorMessage = "A Name is Required")]

View File

@ -8,6 +8,7 @@ namespace NzbDrone.Core.Repository
{ {
public class RootDir public class RootDir
{ {
[SubSonicPrimaryKey]
public virtual int Id { get; set; } public virtual int Id { get; set; }
public string Path { get; set; } public string Path { get; set; }