mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-23 06:45:19 -07:00
better method to obtain the folderName
This commit is contained in:
parent
e6dfd89300
commit
05a83e4e95
3 changed files with 9 additions and 2 deletions
|
@ -45,6 +45,7 @@ namespace NzbDrone.Api.Movie
|
||||||
public bool Monitored { get; set; }
|
public bool Monitored { get; set; }
|
||||||
public MovieStatusType MinimumAvailability { get; set; }
|
public MovieStatusType MinimumAvailability { get; set; }
|
||||||
public bool IsAvailable { get; set; }
|
public bool IsAvailable { get; set; }
|
||||||
|
public string FolderName { get; set; }
|
||||||
|
|
||||||
public int Runtime { get; set; }
|
public int Runtime { get; set; }
|
||||||
public DateTime? LastInfoSync { get; set; }
|
public DateTime? LastInfoSync { get; set; }
|
||||||
|
@ -135,6 +136,7 @@ namespace NzbDrone.Api.Movie
|
||||||
MinimumAvailability = model.MinimumAvailability,
|
MinimumAvailability = model.MinimumAvailability,
|
||||||
|
|
||||||
IsAvailable = model.IsAvailable(),
|
IsAvailable = model.IsAvailable(),
|
||||||
|
FolderName = model.FolderName(),
|
||||||
|
|
||||||
SizeOnDisk = size,
|
SizeOnDisk = size,
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ using NzbDrone.Common.Extensions;
|
||||||
using NzbDrone.Core.Datastore;
|
using NzbDrone.Core.Datastore;
|
||||||
using NzbDrone.Core.Profiles;
|
using NzbDrone.Core.Profiles;
|
||||||
using NzbDrone.Core.MediaFiles;
|
using NzbDrone.Core.MediaFiles;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
namespace NzbDrone.Core.Tv
|
namespace NzbDrone.Core.Tv
|
||||||
{
|
{
|
||||||
|
@ -54,6 +55,11 @@ namespace NzbDrone.Core.Tv
|
||||||
|
|
||||||
public bool HasFile => MovieFileId > 0;
|
public bool HasFile => MovieFileId > 0;
|
||||||
|
|
||||||
|
public string FolderName()
|
||||||
|
{
|
||||||
|
return new DirectoryInfo(Path).Name;
|
||||||
|
}
|
||||||
|
|
||||||
public bool IsAvailable(int delay = 0)
|
public bool IsAvailable(int delay = 0)
|
||||||
{
|
{
|
||||||
//the below line is what was used before delay was implemented, could still be used for cases when delay==0
|
//the below line is what was used before delay was implemented, could still be used for cases when delay==0
|
||||||
|
|
|
@ -137,8 +137,7 @@ module.exports = Marionette.ItemView.extend({
|
||||||
|
|
||||||
if (rootFolder !== 'noChange') {
|
if (rootFolder !== 'noChange') {
|
||||||
var rootFolderPath = RootFolders.get(parseInt(rootFolder, 10));
|
var rootFolderPath = RootFolders.get(parseInt(rootFolder, 10));
|
||||||
var currentPath = m.get('path');
|
var folderName = m.get('folderName');
|
||||||
var folderName = currentPath.substring(currentPath.lastIndexOf('\\')+1);
|
|
||||||
m.set('path', rootFolderPath.get('path')+ folderName);
|
m.set('path', rootFolderPath.get('path')+ folderName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue