Closed revam closed 1 year ago
I would name it LastUpdated
SQL migration:
UPDATE VideoLocal SET LastUpdated = DateCreated WHERE DateCreated IS NOT NULL;
I would name it LastUpdated
We already have an update field (DateTimeUpdate) that's exclusively used by the hash command. And I don't want the import date (and import order!) to shift when someone triggers a rehash.
SQL migration:
UPDATE VideoLocal SET LastUpdated = DateCreated WHERE DateCreated IS NOT NULL;
Will update replace the C# part of the migration with this.
SQL migration:
UPDATE VideoLocal SET LastUpdated = DateCreated WHERE DateCreated IS NOT NULL;
Actually, small problem. The current migration only updates the import date for the files with existing cross-references. Not all the files.
Fair enough on the naming
Do you have a SQL that also check the cross-reference table if a match exists, or should we keep it as C# code? @da3dsoul
I'd need to open it in a console to check
Added the SQL statements provided by @da3dsoul. Any other changes that needs to be made, or is it ok to merge this now?
Should be fine
Removed the now unused database fix helper.
We're currently not tracking when a file was imported. This makes ordering the "Recently Imported" panel on the dashboard difficult to do correctly, so this PR adds a nullable date that's set when a file is either automatically imported by the system or manually imported by the user. It also unsets the date if a manual link is removed by the user, since it is no longer considered as imported.
Changes in this PR
Added
DateTime? DateTimeImported
toVideoLocal
. The naming is to make it consistent with the existing dates present on the model. (We should probably consolidate on a common naming scheme when moving to EF Core, but for now I'm adding this as-is).Added a migration path for each of the database types. This will simply set the import date to the file creation date if the file is currently imported.
Updated the
CommandRequest_ProcessFile
andCommandRequest_LinkFileManually
to set the import date.Updated the manually link endpoints in both v1 and v3 to reset the import date once all cross-references have been removed from the file.
Updated the recently episode/series endpoints (in the v3 api) to use the new field to sort the results.
Made sure cross-references are removed before queuing the new manual link command in the v3 api.
Exposed the import date on the file model in the v3 api.
Removed one extra white-space. :slightly_smiling_face: