This commit is contained in:
tidusjar 2017-02-24 20:59:53 +00:00
commit 0da49440e2
18 changed files with 467 additions and 355 deletions

View file

@ -25,6 +25,7 @@
// ************************************************************************/
#endregion
using System;
using System.Data.Linq.Mapping;
namespace Ombi.Store.Models.Plex
@ -47,5 +48,8 @@ namespace Ombi.Store.Models.Plex
/// Only used for Albums
/// </summary>
public string Artist { get; set; }
public string ItemId { get; set; }
public DateTime AddedAt { get; set; }
}
}

View file

@ -286,7 +286,7 @@ namespace Ombi.Store.Repository
}
}
public bool BatchInsert(IEnumerable<T> entities, string tableName, params string[] values)
public bool BatchInsert(IEnumerable<T> entities, string tableName)
{
// If we have nothing to update, then it didn't fail...
var enumerable = entities as T[] ?? entities.ToArray();

View file

@ -81,7 +81,7 @@ namespace Ombi.Store.Repository
bool UpdateAll(IEnumerable<T> entity);
Task<bool> UpdateAllAsync(IEnumerable<T> entity);
bool BatchInsert(IEnumerable<T> entities, string tableName, params string[] values);
bool BatchInsert(IEnumerable<T> entities, string tableName);
IEnumerable<T> Custom(Func<IDbConnection, IEnumerable<T>> func);
Task<IEnumerable<T>> CustomAsync(Func<IDbConnection, Task<IEnumerable<T>>> func);

View file

@ -174,7 +174,10 @@ CREATE TABLE IF NOT EXISTS PlexContent
Url VARCHAR(100) NOT NULL,
Artist VARCHAR(100),
Seasons BLOB,
Type INTEGER NOT NULL
Type INTEGER NOT NULL,
ItemID VARCHAR(100) NOT NULL,
AddedAt VARCHAR(100) NOT NULL
);
CREATE UNIQUE INDEX IF NOT EXISTS PlexContent_Id ON PlexContent (Id);