--[[----------------------------------------------------------------------------

Fix Stuck Deleted Sync.lua

1. Close Lightroom
2. Locate the following directory (create it if necessary) and place the `Fix Stuck Sync.lua` file in it:
	* Mac: /Users/<username>/Library/Application Support/Adobe/Lightroom CC/Scripts
	* Win: C:\Users\<username>\AppData\Roaming\Adobe\Lightroom CC\Scripts
3. Launch Lightroom
4. There should be a new Scripts menu item, click on this and select Fix Stuck Sync from the dropdown. 
5. The script will run without any feedback, but the sync should clear up within a couple of minutes.
6. Once fixed, the Fix Stuck Sync file can be deleted from the Scripts directory

]]--

import "AgLibrary".withActiveWFModelConnection(

		function( wfModelConnection )

			-- // START 
			--
			-- DELETE THIS COMMENT BEFORE DELIVERING THIS SCRIPT TO A USER
			-- 
			-- This script resolves stuck syncs related to https://jira.corp.adobe.com/browse/OZ-10318
			--
			-- Developer instructions: Replace <assetId> with the affected asset ID.
			-- One call to the flagUploadAsHighPriority model is necessary for each stuck asset.
			--
			-- // END

			local clearStuckSyncModel = wfModelConnection:catalogModel():subModel( 'flagUploadAsHighPriority', '<assetId>' )
			clearStuckSyncModel.onDone = function() end

		end )

--------------------------------------------------------------------------------
