From 54ddc4ad5cc42c45b596c6290ce715f756f653fc Mon Sep 17 00:00:00 2001 From: ZeqMacaw Date: Wed, 4 Mar 2020 12:40:38 -0500 Subject: [PATCH] FIXED: Publishing a changed template does not publish item correctly. --- Crowbar/Core/Steam/SteamPipe.vb | 4 ++- Crowbar/Core/Steam/WorkshopItem.vb | 25 +++++++++++++++++++ .../Widgets/Main Tabs/PublishUserControl.vb | 1 + CrowbarSteamPipe/CrowbarSteamPipe.vb | 2 +- 4 files changed, 30 insertions(+), 2 deletions(-) diff --git a/Crowbar/Core/Steam/SteamPipe.vb b/Crowbar/Core/Steam/SteamPipe.vb index 245a193..2b08d1a 100644 --- a/Crowbar/Core/Steam/SteamPipe.vb +++ b/Crowbar/Core/Steam/SteamPipe.vb @@ -598,7 +598,9 @@ Public Class SteamPipe outputInfo.Status = result outputInfo.UploadedByteCount = CULng(Me.theStreamReader.ReadLine()) outputInfo.TotalUploadedByteCount = CULng(Me.theStreamReader.ReadLine()) - If outputInfo.Status <> "invalid" Then + If outputInfo.Status = "invalid" Then + Dim debug As Integer = 4242 + Else If previousOutputInfo.Status <> outputInfo.Status OrElse previousOutputInfo.UploadedByteCount <> outputInfo.UploadedByteCount OrElse previousOutputInfo.TotalUploadedByteCount <> outputInfo.TotalUploadedByteCount Then If outputInfo.TotalUploadedByteCount > 0 Then Me.theBackgroundWorker.ReportProgress(2, outputInfo) diff --git a/Crowbar/Core/Steam/WorkshopItem.vb b/Crowbar/Core/Steam/WorkshopItem.vb index 4ee7cdf..f64a02c 100644 --- a/Crowbar/Core/Steam/WorkshopItem.vb +++ b/Crowbar/Core/Steam/WorkshopItem.vb @@ -521,6 +521,31 @@ Public Class WorkshopItem #Region "Methods" + Public Sub SetAllChangedForNonEmptyFields() + If Me.theTitle <> "" Then + Me.theTitleIsChanged = True + End If + If Me.theDescription <> "" Then + Me.theDescriptionIsChanged = True + End If + If Me.theChangeNote <> "" Then + Me.theChangeNoteIsChanged = True + End If + If Me.theContentPathFolderOrFileName <> "" Then + Me.theContentPathFolderOrFileNameIsChanged = True + End If + If Me.thePreviewImagePathFileName <> "" Then + Me.thePreviewImagePathFileNameIsChanged = True + End If + + 'NOTE: Always set IsChanged for Visibility and Tags. + Me.theVisibilityIsChanged = True + Me.theTagsIsChanged = True + + 'NOTE: Always set IsChanged for item. + Me.theItemIsChanged = True + End Sub + #End Region #Region "Event Handlers" diff --git a/Crowbar/Widgets/Main Tabs/PublishUserControl.vb b/Crowbar/Widgets/Main Tabs/PublishUserControl.vb index b430ec4..d0a6345 100644 --- a/Crowbar/Widgets/Main Tabs/PublishUserControl.vb +++ b/Crowbar/Widgets/Main Tabs/PublishUserControl.vb @@ -1014,6 +1014,7 @@ Public Class PublishUserControl draftItem = New WorkshopItem() Else draftItem = CType(itemToCopy.Clone(), WorkshopItem) + draftItem.SetAllChangedForNonEmptyFields() End If Me.theDisplayedItems.Add(draftItem) Me.theEntireListOfItems.Add(draftItem) diff --git a/CrowbarSteamPipe/CrowbarSteamPipe.vb b/CrowbarSteamPipe/CrowbarSteamPipe.vb index 2500a56..da0e0f3 100644 --- a/CrowbarSteamPipe/CrowbarSteamPipe.vb +++ b/CrowbarSteamPipe/CrowbarSteamPipe.vb @@ -1473,6 +1473,7 @@ Public Module CrowbarSteamPipe End Sub Private Sub OnSubmitItemUpdate(ByVal pCallResult As SubmitItemUpdateResult_t, ByVal bIOFailure As Boolean) + theItemIsUploading = False sw.WriteLine("OnSubmitItemUpdate") Try If pCallResult.m_eResult = EResult.k_EResultOK Then @@ -1568,7 +1569,6 @@ Public Module CrowbarSteamPipe End If SteamAPI.RunCallbacks() End While - theItemIsUploading = False End Sub 'NOTE: WriteLine only writes string until first LF or CR, so need to adjust how to send this.