Skip to content

Commit

Permalink
FIXED: Publishing a changed template does not publish item correctly.
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeqMacaw committed Mar 4, 2020
1 parent e64dca3 commit 54ddc4a
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Crowbar/Core/Steam/SteamPipe.vb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
25 changes: 25 additions & 0 deletions Crowbar/Core/Steam/WorkshopItem.vb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions Crowbar/Widgets/Main Tabs/PublishUserControl.vb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion CrowbarSteamPipe/CrowbarSteamPipe.vb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 54ddc4a

Please sign in to comment.