mirror of https://github.com/lidarr/Lidarr
Add DB Version to About Page (#124)
This commit is contained in:
parent
b3f92ccaef
commit
e8d44d1cc2
|
@ -15,6 +15,7 @@ class About extends Component {
|
|||
version,
|
||||
isMonoRuntime,
|
||||
runtimeVersion,
|
||||
migrationVersion,
|
||||
appData,
|
||||
startupPath,
|
||||
mode
|
||||
|
@ -38,6 +39,11 @@ class About extends Component {
|
|||
/>
|
||||
}
|
||||
|
||||
<DescriptionListItem
|
||||
title="DB Migration"
|
||||
data={migrationVersion}
|
||||
/>
|
||||
|
||||
<DescriptionListItem
|
||||
title="AppData directory"
|
||||
data={appData}
|
||||
|
@ -63,6 +69,7 @@ About.propTypes = {
|
|||
version: PropTypes.string,
|
||||
isMonoRuntime: PropTypes.bool,
|
||||
runtimeVersion: PropTypes.string,
|
||||
migrationVersion: PropTypes.number,
|
||||
appData: PropTypes.string,
|
||||
startupPath: PropTypes.string,
|
||||
mode: PropTypes.string
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using Nancy;
|
||||
using Nancy;
|
||||
using Nancy.Routing;
|
||||
using NzbDrone.Common.EnvironmentInfo;
|
||||
using NzbDrone.Common.Extensions;
|
||||
|
@ -67,6 +67,7 @@ namespace Lidarr.Api.V1.System
|
|||
Branch = _configFileProvider.Branch,
|
||||
Authentication = _configFileProvider.AuthenticationMethod,
|
||||
SqliteVersion = _database.Version,
|
||||
MigrationVersion = _database.Migration,
|
||||
UrlBase = _configFileProvider.UrlBase,
|
||||
RuntimeVersion = _platformInfo.Version,
|
||||
RuntimeName = PlatformInfo.Platform
|
||||
|
|
|
@ -9,6 +9,7 @@ namespace NzbDrone.Core.Datastore
|
|||
{
|
||||
IDataMapper GetDataMapper();
|
||||
Version Version { get; }
|
||||
int Migration { get; }
|
||||
void Vacuum();
|
||||
}
|
||||
|
||||
|
@ -39,6 +40,16 @@ namespace NzbDrone.Core.Datastore
|
|||
}
|
||||
}
|
||||
|
||||
public int Migration
|
||||
{
|
||||
get
|
||||
{
|
||||
var migration = _datamapperFactory()
|
||||
.ExecuteScalar("SELECT version from VersionInfo ORDER BY version DESC LIMIT 1").ToString();
|
||||
return Convert.ToInt32(migration);
|
||||
}
|
||||
}
|
||||
|
||||
public void Vacuum()
|
||||
{
|
||||
try
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using Marr.Data;
|
||||
|
||||
namespace NzbDrone.Core.Datastore
|
||||
|
@ -24,6 +24,8 @@ namespace NzbDrone.Core.Datastore
|
|||
|
||||
public Version Version => _database.Version;
|
||||
|
||||
public int Migration => _database.Migration;
|
||||
|
||||
public void Vacuum()
|
||||
{
|
||||
_database.Vacuum();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using Marr.Data;
|
||||
|
||||
namespace NzbDrone.Core.Datastore
|
||||
|
@ -24,6 +24,8 @@ namespace NzbDrone.Core.Datastore
|
|||
|
||||
public Version Version => _database.Version;
|
||||
|
||||
public int Migration => _database.Migration;
|
||||
|
||||
public void Vacuum()
|
||||
{
|
||||
_database.Vacuum();
|
||||
|
|
Loading…
Reference in New Issue