Fixed issue with saving to db

pull/470/head
tidusjar 8 years ago
parent f60e880da5
commit 131a99b1bb

@ -121,7 +121,7 @@ namespace PlexRequests.Services.Jobs
ProviderId = epInfo.ProviderId,
RatingKey = metadataVideo.RatingKey,
SeasonNumber = epInfo.SeasonNumber,
ShowTitle = metadataVideo.Title
ShowTitle = metadataVideo.GrandparentThumb
});
}
}

@ -289,14 +289,8 @@ namespace PlexRequests.Store.Repository
ResetCache();
using (var db = Config.DbConnection())
{
var result = enumerable.Sum(e => db.Insert(e));
var format = values.AddPrefix("@", ",");
var processQuery = $"INSERT INTO {tableName} VALUES ({format})";
var result = 0;
foreach (var e in enumerable)
{
result += db.Execute(processQuery, e);
}
return result == enumerable.Length;
}

@ -112,4 +112,4 @@ CREATE TABLE IF NOT EXISTS PlexEpisodes
EpisodeNumber INTEGER NOT NULL
);
CREATE UNIQUE INDEX IF NOT EXISTS PlexEpisodes_Id ON PlexEpisodes (Id);
CREATE UNIQUE INDEX IF NOT EXISTS PlexEpisodes_ProviderId ON PlexEpisodes (ProviderId);
CREATE INDEX IF NOT EXISTS PlexEpisodes_ProviderId ON PlexEpisodes (ProviderId);
Loading…
Cancel
Save