mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 16:11:10 +00:00
Adds the SSD content setting to the library model and persistence
Stores whether the content of a library is on a solid state drive, off by default, so scans can choose between parallel and sequential reads.
This commit is contained in:
1 parent
6e77cf3302
commit
6eac3d578e
6 files changed
+3962
No files matched your search
+5
@@ -80,6 +80,11 @@ public class LibraryEntity : IStorageEntity, IAuditableEntity
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public bool ShouldSkipUnchangedDirectoriesDuringScan { get; init; }
|
public bool ShouldSkipUnchangedDirectoriesDuringScan { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets whether the content of this media library is stored on a solid state drive, in which case the file discovery and content hashing stages read the files in parallel.
|
||||||
|
/// </summary>
|
||||||
|
public bool IsContentOnSsd { get; init; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value indicating whether the consumption progress of the media library items is tracked.
|
/// Gets a value indicating whether the consumption progress of the media library items is tracked.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -79,6 +79,10 @@ public class LibraryConfiguration : IEntityTypeConfiguration<LibraryEntity>
|
|||||||
.HasDefaultValue(null)
|
.HasDefaultValue(null)
|
||||||
.HasColumnOrder(17);
|
.HasColumnOrder(17);
|
||||||
|
|
||||||
|
builder.Property(library => library.IsContentOnSsd)
|
||||||
|
.HasDefaultValue(false)
|
||||||
|
.HasColumnOrder(18);
|
||||||
|
|
||||||
// one user with many libraries
|
// one user with many libraries
|
||||||
builder.HasOne(library => library.User)
|
builder.HasOne(library => library.User)
|
||||||
.WithMany(user => user.Libraries)
|
.WithMany(user => user.Libraries)
|
||||||
|
|||||||
Generated
+3902
File diff suppressed because it is too large.
Load diff
+30
@@ -0,0 +1,30 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace Lumina.DataAccess.Common.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class AddsIsContentOnSsdToLibraries : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<bool>(
|
||||||
|
name: "IsContentOnSsd",
|
||||||
|
table: "Libraries",
|
||||||
|
type: "INTEGER",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: false)
|
||||||
|
.Annotation("Relational:ColumnOrder", 18);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "IsContentOnSsd",
|
||||||
|
table: "Libraries");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1521,6 +1521,12 @@ namespace Lumina.DataAccess.Common.Migrations
|
|||||||
.HasColumnType("TEXT")
|
.HasColumnType("TEXT")
|
||||||
.HasColumnOrder(12);
|
.HasColumnOrder(12);
|
||||||
|
|
||||||
|
b.Property<bool>("IsContentOnSsd")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("INTEGER")
|
||||||
|
.HasDefaultValue(false)
|
||||||
|
.HasColumnOrder(18);
|
||||||
|
|
||||||
b.Property<bool>("IsEnabled")
|
b.Property<bool>("IsEnabled")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasColumnType("INTEGER")
|
.HasColumnType("INTEGER")
|
||||||
|
|||||||
+15
@@ -76,6 +76,12 @@ public class Library : AggregateRoot<LibraryId>
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public bool ShouldSkipUnchangedDirectoriesDuringScan { get; private set; }
|
public bool ShouldSkipUnchangedDirectoriesDuringScan { get; private set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets whether the content of this media library is stored on a solid state drive. When it is, the file discovery and content hashing stages read the files in parallel,
|
||||||
|
/// which takes advantage of the low latency of solid state drives. Mechanical hard drives keep those reads sequential, because parallel reads can reduce their throughput.
|
||||||
|
/// </summary>
|
||||||
|
public bool IsContentOnSsd { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the consumption settings of the media library.
|
/// Gets the consumption settings of the media library.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -111,6 +117,7 @@ public class Library : AggregateRoot<LibraryId>
|
|||||||
/// <param name="canDownloadMetadataFromWeb">Whether this media library should update the metadata of its elements from the web, or not.</param>
|
/// <param name="canDownloadMetadataFromWeb">Whether this media library should update the metadata of its elements from the web, or not.</param>
|
||||||
/// <param name="shouldSaveMetadataInMediaDirectories">Whether this media library should copy the downloaded metadata into the media library content locations, or not.</param>
|
/// <param name="shouldSaveMetadataInMediaDirectories">Whether this media library should copy the downloaded metadata into the media library content locations, or not.</param>
|
||||||
/// <param name="shouldSkipUnchangedDirectoriesDuringScan">Whether this media library should skip the directories whose contents have not changed since the last scan, during the scan, or not.</param>
|
/// <param name="shouldSkipUnchangedDirectoriesDuringScan">Whether this media library should skip the directories whose contents have not changed since the last scan, during the scan, or not.</param>
|
||||||
|
/// <param name="isContentOnSsd">Whether the content of this media library is stored on a solid state drive.</param>
|
||||||
/// <param name="consumptionSettings">The consumption settings of the media library.</param>
|
/// <param name="consumptionSettings">The consumption settings of the media library.</param>
|
||||||
/// <param name="pathTemplate">The template describing the structure of the media library on disk.</param>
|
/// <param name="pathTemplate">The template describing the structure of the media library on disk.</param>
|
||||||
/// <param name="scanIds">The list of objects representing the unique identifier of scans of the media library.</param>
|
/// <param name="scanIds">The list of objects representing the unique identifier of scans of the media library.</param>
|
||||||
@@ -126,6 +133,7 @@ public class Library : AggregateRoot<LibraryId>
|
|||||||
bool canDownloadMetadataFromWeb,
|
bool canDownloadMetadataFromWeb,
|
||||||
bool shouldSaveMetadataInMediaDirectories,
|
bool shouldSaveMetadataInMediaDirectories,
|
||||||
bool shouldSkipUnchangedDirectoriesDuringScan,
|
bool shouldSkipUnchangedDirectoriesDuringScan,
|
||||||
|
bool isContentOnSsd,
|
||||||
LibraryConsumptionSettings consumptionSettings,
|
LibraryConsumptionSettings consumptionSettings,
|
||||||
LibraryPathTemplate pathTemplate,
|
LibraryPathTemplate pathTemplate,
|
||||||
List<ScanId> scanIds) : base(id)
|
List<ScanId> scanIds) : base(id)
|
||||||
@@ -140,6 +148,7 @@ public class Library : AggregateRoot<LibraryId>
|
|||||||
CanDownloadMetadataFromWeb = canDownloadMetadataFromWeb;
|
CanDownloadMetadataFromWeb = canDownloadMetadataFromWeb;
|
||||||
ShouldSaveMetadataInMediaDirectories = shouldSaveMetadataInMediaDirectories;
|
ShouldSaveMetadataInMediaDirectories = shouldSaveMetadataInMediaDirectories;
|
||||||
ShouldSkipUnchangedDirectoriesDuringScan = shouldSkipUnchangedDirectoriesDuringScan;
|
ShouldSkipUnchangedDirectoriesDuringScan = shouldSkipUnchangedDirectoriesDuringScan;
|
||||||
|
IsContentOnSsd = isContentOnSsd;
|
||||||
ConsumptionSettings = consumptionSettings;
|
ConsumptionSettings = consumptionSettings;
|
||||||
PathTemplate = pathTemplate;
|
PathTemplate = pathTemplate;
|
||||||
_scanIds = scanIds;
|
_scanIds = scanIds;
|
||||||
@@ -158,6 +167,7 @@ public class Library : AggregateRoot<LibraryId>
|
|||||||
/// <param name="canDownloadMetadataFromWeb">Whether this media library should update the metadata of its elements from the web, or not.</param>
|
/// <param name="canDownloadMetadataFromWeb">Whether this media library should update the metadata of its elements from the web, or not.</param>
|
||||||
/// <param name="shouldSaveMetadataInMediaDirectories">Whether this media library should copy the downloaded metadata into the media library content locations, or not.</param>
|
/// <param name="shouldSaveMetadataInMediaDirectories">Whether this media library should copy the downloaded metadata into the media library content locations, or not.</param>
|
||||||
/// <param name="shouldSkipUnchangedDirectoriesDuringScan">Whether this media library should skip the directories whose contents have not changed since the last scan, during the scan, or not.</param>
|
/// <param name="shouldSkipUnchangedDirectoriesDuringScan">Whether this media library should skip the directories whose contents have not changed since the last scan, during the scan, or not.</param>
|
||||||
|
/// <param name="isContentOnSsd">Whether the content of this media library is stored on a solid state drive.</param>
|
||||||
/// <param name="consumptionSettings">The consumption settings of the media library.</param>
|
/// <param name="consumptionSettings">The consumption settings of the media library.</param>
|
||||||
/// <param name="pathTemplate">The template describing the structure of the media library on disk.</param>
|
/// <param name="pathTemplate">The template describing the structure of the media library on disk.</param>
|
||||||
/// <param name="scanIds">The list of objects representing the unique identifier of scans of the media library.</param>
|
/// <param name="scanIds">The list of objects representing the unique identifier of scans of the media library.</param>
|
||||||
@@ -175,6 +185,7 @@ public class Library : AggregateRoot<LibraryId>
|
|||||||
bool canDownloadMetadataFromWeb,
|
bool canDownloadMetadataFromWeb,
|
||||||
bool shouldSaveMetadataInMediaDirectories,
|
bool shouldSaveMetadataInMediaDirectories,
|
||||||
bool shouldSkipUnchangedDirectoriesDuringScan,
|
bool shouldSkipUnchangedDirectoriesDuringScan,
|
||||||
|
bool isContentOnSsd,
|
||||||
LibraryConsumptionSettings consumptionSettings,
|
LibraryConsumptionSettings consumptionSettings,
|
||||||
LibraryPathTemplate pathTemplate,
|
LibraryPathTemplate pathTemplate,
|
||||||
List<ScanId> scanIds)
|
List<ScanId> scanIds)
|
||||||
@@ -200,6 +211,7 @@ public class Library : AggregateRoot<LibraryId>
|
|||||||
canDownloadMetadataFromWeb,
|
canDownloadMetadataFromWeb,
|
||||||
shouldSaveMetadataInMediaDirectories,
|
shouldSaveMetadataInMediaDirectories,
|
||||||
shouldSkipUnchangedDirectoriesDuringScan,
|
shouldSkipUnchangedDirectoriesDuringScan,
|
||||||
|
isContentOnSsd,
|
||||||
consumptionSettings,
|
consumptionSettings,
|
||||||
pathTemplate,
|
pathTemplate,
|
||||||
scanIds
|
scanIds
|
||||||
@@ -220,6 +232,7 @@ public class Library : AggregateRoot<LibraryId>
|
|||||||
/// <param name="canDownloadMetadataFromWeb">Whether this media library should update the metadata of its elements from the web, or not.</param>
|
/// <param name="canDownloadMetadataFromWeb">Whether this media library should update the metadata of its elements from the web, or not.</param>
|
||||||
/// <param name="shouldSaveMetadataInMediaDirectories">Whether this media library should copy the downloaded metadata into the media library content locations, or not.</param>
|
/// <param name="shouldSaveMetadataInMediaDirectories">Whether this media library should copy the downloaded metadata into the media library content locations, or not.</param>
|
||||||
/// <param name="shouldSkipUnchangedDirectoriesDuringScan">Whether this media library should skip the directories whose contents have not changed since the last scan, during the scan, or not.</param>
|
/// <param name="shouldSkipUnchangedDirectoriesDuringScan">Whether this media library should skip the directories whose contents have not changed since the last scan, during the scan, or not.</param>
|
||||||
|
/// <param name="isContentOnSsd">Whether the content of this media library is stored on a solid state drive.</param>
|
||||||
/// <param name="consumptionSettings">The consumption settings of the media library.</param>
|
/// <param name="consumptionSettings">The consumption settings of the media library.</param>
|
||||||
/// <param name="pathTemplate">The template describing the structure of the media library on disk.</param>
|
/// <param name="pathTemplate">The template describing the structure of the media library on disk.</param>
|
||||||
/// <param name="scanIds">The list of objects representing the unique identifier of scans of the media library.</param>
|
/// <param name="scanIds">The list of objects representing the unique identifier of scans of the media library.</param>
|
||||||
@@ -238,6 +251,7 @@ public class Library : AggregateRoot<LibraryId>
|
|||||||
bool canDownloadMetadataFromWeb,
|
bool canDownloadMetadataFromWeb,
|
||||||
bool shouldSaveMetadataInMediaDirectories,
|
bool shouldSaveMetadataInMediaDirectories,
|
||||||
bool shouldSkipUnchangedDirectoriesDuringScan,
|
bool shouldSkipUnchangedDirectoriesDuringScan,
|
||||||
|
bool isContentOnSsd,
|
||||||
LibraryConsumptionSettings consumptionSettings,
|
LibraryConsumptionSettings consumptionSettings,
|
||||||
LibraryPathTemplate pathTemplate,
|
LibraryPathTemplate pathTemplate,
|
||||||
List<ScanId> scanIds)
|
List<ScanId> scanIds)
|
||||||
@@ -263,6 +277,7 @@ public class Library : AggregateRoot<LibraryId>
|
|||||||
canDownloadMetadataFromWeb,
|
canDownloadMetadataFromWeb,
|
||||||
shouldSaveMetadataInMediaDirectories,
|
shouldSaveMetadataInMediaDirectories,
|
||||||
shouldSkipUnchangedDirectoriesDuringScan,
|
shouldSkipUnchangedDirectoriesDuringScan,
|
||||||
|
isContentOnSsd,
|
||||||
consumptionSettings,
|
consumptionSettings,
|
||||||
pathTemplate,
|
pathTemplate,
|
||||||
scanIds
|
scanIds
|
||||||
|
|||||||
Reference in new issue
Block a user