mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-21 13:53:19 -07:00
- Added a visual indication on the UI to tell the admin there is a update available.
- We are now also recording the last scheduled run in the database
This commit is contained in:
parent
af028f0b56
commit
df3dc4ac04
28 changed files with 392 additions and 45 deletions
|
@ -47,5 +47,7 @@ namespace PlexRequests.Core
|
|||
public const string CouchPotatoQueued = "CouchPotatoQueued";
|
||||
|
||||
public const string GetBaseUrl = "GetBaseUrl";
|
||||
|
||||
public const string LastestProductVersion = "LatestProductVersion";
|
||||
}
|
||||
}
|
|
@ -49,10 +49,9 @@ namespace PlexRequests.Core
|
|||
var entity = new RequestBlobs { Type = model.Type, Content = ByteConverterHelper.ReturnBytes(model), ProviderId = model.ProviderId };
|
||||
var id = Repo.Insert(entity);
|
||||
|
||||
// TODO Keep an eye on this, since we are now doing 2 DB update for 1 single request, inserting and then updating
|
||||
model.Id = (int)id;
|
||||
|
||||
entity = new RequestBlobs { Type = model.Type, Content = ByteConverterHelper.ReturnBytes(model), ProviderId = model.ProviderId, Id = (int)id, MusicId = model.MusicBrainzId};
|
||||
entity = new RequestBlobs { Type = model.Type, Content = ByteConverterHelper.ReturnBytes(model), ProviderId = model.ProviderId, Id = (int)id, MusicId = model.MusicBrainzId };
|
||||
var result = Repo.Update(entity);
|
||||
|
||||
return result ? id : -1;
|
||||
|
|
|
@ -24,21 +24,11 @@
|
|||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
// ************************************************************************/
|
||||
#endregion
|
||||
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace PlexRequests.Core.Models
|
||||
{
|
||||
public class StatusModel
|
||||
{
|
||||
public string Version { get; set; }
|
||||
public int DBVersion {
|
||||
get
|
||||
{
|
||||
string trimStatus = new Regex("[^0-9]", RegexOptions.Compiled).Replace(Version, string.Empty).PadRight(4, '0');
|
||||
return int.Parse(trimStatus);
|
||||
}
|
||||
}
|
||||
public bool UpdateAvailable { get; set; }
|
||||
public string UpdateUri { get; set; }
|
||||
public string DownloadUri { get; set; }
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
using Mono.Data.Sqlite;
|
||||
using NLog;
|
||||
|
@ -72,18 +73,19 @@ namespace PlexRequests.Core
|
|||
|
||||
private int CheckSchema()
|
||||
{
|
||||
var checker = new StatusChecker();
|
||||
var status = checker.GetStatus();
|
||||
var productVersion = AssemblyHelper.GetProductVersion();
|
||||
var trimStatus = new Regex("[^0-9]", RegexOptions.Compiled).Replace(productVersion, string.Empty).PadRight(4, '0');
|
||||
var version = int.Parse(trimStatus);
|
||||
|
||||
var connection = Db.DbConnection();
|
||||
var schema = connection.GetSchemaVersion();
|
||||
if (schema == null)
|
||||
{
|
||||
connection.CreateSchema(status.DBVersion); // Set the default.
|
||||
connection.CreateSchema(version); // Set the default.
|
||||
schema = connection.GetSchemaVersion();
|
||||
}
|
||||
|
||||
var version = schema.SchemaVersion;
|
||||
version = schema.SchemaVersion;
|
||||
|
||||
return version;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue