LANCommander/LANCommander.Launcher.Models/DownloadQueueRedistributable.cs
Pat Hartl 27d6ea6486 Add ability to modify a game's installation
- DownloadService has been renamed to InstallService
- In the library item context menu, there is a new option "Modify". This allows the user to selsct any additional addons to install as well as move the game to a separate storage location.
- Fixed issue where transfers were being double updated for installs
- Force UI update whenever queue is updates
2024-10-26 15:48:47 -05:00

56 lines
2.3 KiB
C#

using LANCommander.SDK.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LANCommander.Launcher.Models
{
public class DownloadQueueRedistributable : IInstallQueueItem
{
public Guid Id { get; set; }
public Guid[] AddonIds { get; set; }
public string Title { get; set; }
public string Version { get; set; }
public string InstallDirectory { get; set; }
public Guid CoverId { get; set; }
public Guid IconId { get; set; }
public DateTime QueuedOn { get; set; }
public DateTime? CompletedOn { get; set; }
public bool IsUpdate { get; set; }
public bool State
{
get
{
switch (Status)
{
case GameInstallStatus.Downloading:
case GameInstallStatus.InstallingRedistributables:
case GameInstallStatus.InstallingMods:
case GameInstallStatus.InstallingExpansions:
case GameInstallStatus.RunningScripts:
case GameInstallStatus.DownloadingSaves:
return true;
default:
return false;
}
}
}
public GameInstallStatus Status { get; set; }
public SDK.Models.Redistributable Redistributable { get; set; }
public float Progress { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public double TransferSpeed { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public long BytesDownloaded { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public long TotalBytes { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public DownloadQueueRedistributable(SDK.Models.Redistributable redistributable)
{
Redistributable = redistributable;
Id = redistributable.Id;
Title = redistributable.Name;
Version = redistributable.Archives.OrderByDescending(a => a.CreatedOn).FirstOrDefault()?.Version;
}
}
}