Skip to content

Commit fd5c14a

Browse files
tablackburnclaude
andcommitted
Replace shorthand variable names with full words per coding standards
Rename variables throughout the codebase to comply with agent instructions that prohibit abbreviations like Info, Params, Config, and Msg: - $*Info → $*Information (serverInfo, playlistInfo, mediaInfo, etc.) - $*Params → $*Parameters (getParams, libParams, queryParams, etc.) - $*Config → $*Configuration (ServerConfig parameter) - $*Msg → $*Message (errorMsg, filterMsg) Also fix PSScriptAnalyzer plural noun warnings by renaming 5 functions: - Get-PatSectionNameCompletions → Get-PatSectionNameCompletion - Get-PatSectionIdCompletions → Get-PatSectionIdCompletion - Get-PatLibraryPathCompletions → Get-PatLibraryPathCompletion - Get-PatCollectionTitleCompletions → Get-PatCollectionTitleCompletion - Get-PatPlaylistTitleCompletions → Get-PatPlaylistTitleCompletion 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 1c8441c commit fd5c14a

30 files changed

Lines changed: 298 additions & 298 deletions

PlexAutomationToolkit/Private/Get-PatCompleterResult.ps1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function Get-PatSectionNameCompletions {
1+
function Get-PatSectionNameCompletion {
22
<#
33
.SYNOPSIS
44
Gets section name completions for tab completion.
@@ -43,7 +43,7 @@ function Get-PatSectionNameCompletions {
4343
}
4444
}
4545

46-
function Get-PatSectionIdCompletions {
46+
function Get-PatSectionIdCompletion {
4747
<#
4848
.SYNOPSIS
4949
Gets section ID completions for tab completion.
@@ -89,7 +89,7 @@ function Get-PatSectionIdCompletions {
8989
}
9090
}
9191

92-
function Get-PatLibraryPathCompletions {
92+
function Get-PatLibraryPathCompletion {
9393
<#
9494
.SYNOPSIS
9595
Gets library path completions for tab completion.
@@ -222,7 +222,7 @@ function Get-PatLibraryPathCompletions {
222222
}
223223
}
224224

225-
function Get-PatCollectionTitleCompletions {
225+
function Get-PatCollectionTitleCompletion {
226226
<#
227227
.SYNOPSIS
228228
Gets collection title completions for tab completion.
@@ -279,7 +279,7 @@ function Get-PatCollectionTitleCompletions {
279279
}
280280
}
281281

282-
function Get-PatPlaylistTitleCompletions {
282+
function Get-PatPlaylistTitleCompletion {
283283
<#
284284
.SYNOPSIS
285285
Gets playlist title completions for tab completion.

PlexAutomationToolkit/Private/Get-PatServerToken.ps1

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ function Get-PatServerToken {
3838
[Parameter(Mandatory = $true, ParameterSetName = 'ByConfig')]
3939
[ValidateNotNull()]
4040
[PSCustomObject]
41-
$ServerConfig
41+
$ServerConfiguration
4242
)
4343

44-
$name = if ($ServerConfig) { $ServerConfig.name } else { $ServerName }
44+
$name = if ($ServerConfiguration) { $ServerConfiguration.name } else { $ServerName }
4545
$secretName = "PlexAutomationToolkit/$name"
4646

4747
# Try vault first if SecretManagement is available
@@ -59,11 +59,11 @@ function Get-PatServerToken {
5959
}
6060

6161
# Fall back to inline token if ServerConfig provided
62-
if ($ServerConfig -and
63-
$ServerConfig.PSObject.Properties['token'] -and
64-
-not [string]::IsNullOrWhiteSpace($ServerConfig.token)) {
62+
if ($ServerConfiguration -and
63+
$ServerConfiguration.PSObject.Properties['token'] -and
64+
-not [string]::IsNullOrWhiteSpace($ServerConfiguration.token)) {
6565
Write-Debug "Using inline token for server '$name'"
66-
return $ServerConfig.token
66+
return $ServerConfiguration.token
6767
}
6868

6969
Write-Debug "No token found for server '$name'"

PlexAutomationToolkit/Private/Invoke-PatFileDownload.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ function Invoke-PatFileDownload {
113113
Write-Verbose "Downloading file from: $Uri"
114114
Write-Verbose "Destination: $OutFile"
115115

116-
$webRequestParams = @{
116+
$webRequestParameters = @{
117117
Uri = $Uri
118118
Headers = $headers
119119
UseBasicParsing = $true
@@ -123,7 +123,7 @@ function Invoke-PatFileDownload {
123123
# For resume, we need to handle the response differently
124124
if ($existingSize -gt 0 -and $headers.ContainsKey('Range')) {
125125
# Resuming - append to existing file
126-
$response = Invoke-WebRequest @webRequestParams
126+
$response = Invoke-WebRequest @webRequestParameters
127127

128128
# Check if server supports range requests (206 Partial Content)
129129
if ($response.StatusCode -eq 206) {
@@ -148,7 +148,7 @@ function Invoke-PatFileDownload {
148148
}
149149
else {
150150
# Fresh download - use -OutFile for efficient streaming
151-
Invoke-WebRequest @webRequestParams -OutFile $OutFile
151+
Invoke-WebRequest @webRequestParameters -OutFile $OutFile
152152
}
153153

154154
# Verify download

PlexAutomationToolkit/Private/Register-PatArgumentCompleter.ps1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function Register-PatArgumentCompleter {
3333
$params['Token'] = $fakeBoundParameters['Token']
3434
}
3535

36-
Get-PatSectionNameCompletions @params
36+
Get-PatSectionNameCompletion @params
3737
}
3838

3939
# SectionId completer - used by multiple commands
@@ -48,7 +48,7 @@ function Register-PatArgumentCompleter {
4848
$params['Token'] = $fakeBoundParameters['Token']
4949
}
5050

51-
Get-PatSectionIdCompletions @params
51+
Get-PatSectionIdCompletion @params
5252
}
5353

5454
# Path completer for Update-PatLibrary - browses Plex server filesystem
@@ -66,7 +66,7 @@ function Register-PatArgumentCompleter {
6666
$params['SectionName'] = $fakeBoundParameters['SectionName']
6767
}
6868

69-
Get-PatLibraryPathCompletions @params
69+
Get-PatLibraryPathCompletion @params
7070
}
7171

7272
# Collection name completer
@@ -87,7 +87,7 @@ function Register-PatArgumentCompleter {
8787
$params['SectionName'] = $fakeBoundParameters['SectionName']
8888
}
8989

90-
Get-PatCollectionTitleCompletions @params
90+
Get-PatCollectionTitleCompletion @params
9191
}
9292

9393
# Playlist title completer
@@ -102,7 +102,7 @@ function Register-PatArgumentCompleter {
102102
$params['Token'] = $fakeBoundParameters['Token']
103103
}
104104

105-
Get-PatPlaylistTitleCompletions @params
105+
Get-PatPlaylistTitleCompletion @params
106106
}
107107

108108
# ============================================================

PlexAutomationToolkit/Private/Remove-PatServerToken.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ function Remove-PatServerToken {
3333
if (Get-PatSecretManagementAvailable) {
3434
try {
3535
# Check if secret exists using Get-SecretInfo (doesn't expose the actual secret)
36-
$secretInfo = Get-SecretInfo -Name $secretName -ErrorAction SilentlyContinue
37-
if ($secretInfo) {
36+
$secretInformation = Get-SecretInfo -Name $secretName -ErrorAction SilentlyContinue
37+
if ($secretInformation) {
3838
Remove-Secret -Name $secretName -ErrorAction Stop
3939
Write-Debug "Removed token from vault for server '$ServerName'"
4040
}

PlexAutomationToolkit/Public/Add-PatCollectionItem.ps1

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -121,46 +121,46 @@ function Add-PatCollectionItem {
121121

122122
# Get machine identifier for URI construction
123123
try {
124-
$serverInfoUri = Join-PatUri -BaseUri $effectiveUri -Endpoint '/'
125-
$serverInfo = Invoke-PatApi -Uri $serverInfoUri -Headers $headers -ErrorAction 'Stop'
126-
$machineIdentifier = $serverInfo.machineIdentifier
124+
$serverInformationUri = Join-PatUri -BaseUri $effectiveUri -Endpoint '/'
125+
$serverInformation = Invoke-PatApi -Uri $serverInformationUri -Headers $headers -ErrorAction 'Stop'
126+
$machineIdentifier = $serverInformation.machineIdentifier
127127
Write-Verbose "Server machine identifier: $machineIdentifier"
128128
}
129129
catch {
130130
throw "Failed to retrieve server machine identifier: $($_.Exception.Message)"
131131
}
132132

133133
$resolvedId = $CollectionId
134-
$collectionInfo = $null
134+
$collectionInformation = $null
135135

136136
if ($PSCmdlet.ParameterSetName -like 'ByName*') {
137137
# Only pass ServerUri if explicitly specified, otherwise let Get-PatCollection use default server with auth
138-
$getParams = @{
138+
$getParameters = @{
139139
CollectionName = $CollectionName
140140
ErrorAction = 'Stop'
141141
}
142-
if ($script:serverContext.WasExplicitUri) { $getParams['ServerUri'] = $effectiveUri }
142+
if ($script:serverContext.WasExplicitUri) { $getParameters['ServerUri'] = $effectiveUri }
143143
if ($LibraryName) {
144-
$getParams['LibraryName'] = $LibraryName
144+
$getParameters['LibraryName'] = $LibraryName
145145
}
146146
else {
147-
$getParams['LibraryId'] = $LibraryId
147+
$getParameters['LibraryId'] = $LibraryId
148148
}
149149

150-
$collection = Get-PatCollection @getParams
150+
$collection = Get-PatCollection @getParameters
151151
if (-not $collection) {
152152
$libDesc = if ($LibraryName) { "library '$LibraryName'" } else { "library $LibraryId" }
153153
throw "No collection found with name '$CollectionName' in $libDesc"
154154
}
155155
$resolvedId = $collection.CollectionId
156-
$collectionInfo = $collection
156+
$collectionInformation = $collection
157157
}
158158
else {
159159
try {
160160
# Only pass ServerUri if explicitly specified, otherwise let Get-PatCollection use default server with auth
161-
$getParams = @{ CollectionId = $CollectionId; ErrorAction = 'Stop' }
162-
if ($script:serverContext.WasExplicitUri) { $getParams['ServerUri'] = $effectiveUri }
163-
$collectionInfo = Get-PatCollection @getParams
161+
$getParameters = @{ CollectionId = $CollectionId; ErrorAction = 'Stop' }
162+
if ($script:serverContext.WasExplicitUri) { $getParameters['ServerUri'] = $effectiveUri }
163+
$collectionInformation = Get-PatCollection @getParameters
164164
}
165165
catch {
166166
Write-Verbose "Could not retrieve collection info for ID $CollectionId"
@@ -182,8 +182,8 @@ function Add-PatCollectionItem {
182182
return
183183
}
184184

185-
$collectionDesc = if ($collectionInfo) {
186-
"'$($collectionInfo.Title)'"
185+
$collectionDesc = if ($collectionInformation) {
186+
"'$($collectionInformation.Title)'"
187187
}
188188
else {
189189
"Collection $resolvedId"
@@ -212,9 +212,9 @@ function Add-PatCollectionItem {
212212

213213
if ($PassThru) {
214214
# Only pass ServerUri if explicitly specified
215-
$getParams = @{ CollectionId = $resolvedId; ErrorAction = 'Stop' }
216-
if ($script:serverContext.WasExplicitUri) { $getParams['ServerUri'] = $effectiveUri }
217-
Get-PatCollection @getParams
215+
$getParameters = @{ CollectionId = $resolvedId; ErrorAction = 'Stop' }
216+
if ($script:serverContext.WasExplicitUri) { $getParameters['ServerUri'] = $effectiveUri }
217+
Get-PatCollection @getParameters
218218
}
219219
}
220220
catch {

PlexAutomationToolkit/Public/Add-PatPlaylistItem.ps1

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ function Add-PatPlaylistItem {
103103
# Get machine identifier for URI construction
104104
$machineIdentifier = $null
105105
try {
106-
$serverInfoUri = Join-PatUri -BaseUri $effectiveUri -Endpoint '/'
107-
$serverInfo = Invoke-PatApi -Uri $serverInfoUri -Headers $headers -ErrorAction 'Stop'
108-
$machineIdentifier = $serverInfo.machineIdentifier
106+
$serverInformationUri = Join-PatUri -BaseUri $effectiveUri -Endpoint '/'
107+
$serverInformation = Invoke-PatApi -Uri $serverInformationUri -Headers $headers -ErrorAction 'Stop'
108+
$machineIdentifier = $serverInformation.machineIdentifier
109109
Write-Verbose "Server machine identifier: $machineIdentifier"
110110
}
111111
catch {
@@ -114,25 +114,25 @@ function Add-PatPlaylistItem {
114114

115115
# Resolve playlist ID if using name
116116
$resolvedId = $PlaylistId
117-
$playlistInfo = $null
117+
$playlistInformation = $null
118118

119119
if ($PSCmdlet.ParameterSetName -eq 'ByName') {
120120
# Only pass ServerUri if explicitly specified
121-
$getParams = @{ PlaylistName = $PlaylistName; ErrorAction = 'Stop' }
122-
if ($script:serverContext.WasExplicitUri) { $getParams['ServerUri'] = $effectiveUri }
123-
$playlist = Get-PatPlaylist @getParams
121+
$getParameters = @{ PlaylistName = $PlaylistName; ErrorAction = 'Stop' }
122+
if ($script:serverContext.WasExplicitUri) { $getParameters['ServerUri'] = $effectiveUri }
123+
$playlist = Get-PatPlaylist @getParameters
124124
if (-not $playlist) {
125125
throw "No playlist found with name '$PlaylistName'"
126126
}
127127
$resolvedId = $playlist.PlaylistId
128-
$playlistInfo = $playlist
128+
$playlistInformation = $playlist
129129
}
130130
else {
131131
try {
132132
# Only pass ServerUri if explicitly specified
133-
$getParams = @{ PlaylistId = $PlaylistId; ErrorAction = 'Stop' }
134-
if ($script:serverContext.WasExplicitUri) { $getParams['ServerUri'] = $effectiveUri }
135-
$playlistInfo = Get-PatPlaylist @getParams
133+
$getParameters = @{ PlaylistId = $PlaylistId; ErrorAction = 'Stop' }
134+
if ($script:serverContext.WasExplicitUri) { $getParameters['ServerUri'] = $effectiveUri }
135+
$playlistInformation = Get-PatPlaylist @getParameters
136136
}
137137
catch {
138138
Write-Verbose "Could not retrieve playlist info for ID $PlaylistId"
@@ -157,8 +157,8 @@ function Add-PatPlaylistItem {
157157
}
158158

159159
# Build descriptive target for confirmation
160-
$playlistDesc = if ($playlistInfo) {
161-
"'$($playlistInfo.Title)'"
160+
$playlistDesc = if ($playlistInformation) {
161+
"'$($playlistInformation.Title)'"
162162
}
163163
else {
164164
"Playlist $resolvedId"
@@ -187,9 +187,9 @@ function Add-PatPlaylistItem {
187187

188188
if ($PassThru) {
189189
# Only pass ServerUri if explicitly specified
190-
$getParams = @{ PlaylistId = $resolvedId; ErrorAction = 'Stop' }
191-
if ($script:serverContext.WasExplicitUri) { $getParams['ServerUri'] = $effectiveUri }
192-
Get-PatPlaylist @getParams
190+
$getParameters = @{ PlaylistId = $resolvedId; ErrorAction = 'Stop' }
191+
if ($script:serverContext.WasExplicitUri) { $getParameters['ServerUri'] = $effectiveUri }
192+
Get-PatPlaylist @getParameters
193193
}
194194
}
195195
catch {

PlexAutomationToolkit/Public/Compare-PatWatchStatus.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,10 +283,10 @@ function Compare-PatWatchStatus {
283283
Write-Verbose "Found $($differences.Count) items with different watch status"
284284

285285
if ($differences.Count -eq 0) {
286-
$filterMsg = if ($WatchedOnSourceOnly) { " (filtered: watched on source only)" }
286+
$filterMessage = if ($WatchedOnSourceOnly) { " (filtered: watched on source only)" }
287287
elseif ($WatchedOnTargetOnly) { " (filtered: watched on target only)" }
288288
else { "" }
289-
Write-Information "Watch status is in sync between '$SourceServerName' and '$TargetServerName'$filterMsg" -InformationAction Continue
289+
Write-Information "Watch status is in sync between '$SourceServerName' and '$TargetServerName'$filterMessage" -InformationAction Continue
290290
}
291291
else {
292292
Write-Information "Found $($differences.Count) items with different watch status" -InformationAction Continue

PlexAutomationToolkit/Public/Get-PatCollection.ps1

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,12 @@ function Get-PatCollection {
159159
$libName = $null
160160
$libId = [int]$apiResult.librarySectionID
161161
if (-not $script:libraryCache) {
162-
$libParams = @{ ErrorAction = 'SilentlyContinue' }
162+
$libraryParameters = @{ ErrorAction = 'SilentlyContinue' }
163163
if ($script:serverContext.WasExplicitUri) {
164-
$libParams['ServerUri'] = $effectiveUri
165-
if ($script:serverContext.Token) { $libParams['Token'] = $script:serverContext.Token }
164+
$libraryParameters['ServerUri'] = $effectiveUri
165+
if ($script:serverContext.Token) { $libraryParameters['Token'] = $script:serverContext.Token }
166166
}
167-
$script:libraryCache = Get-PatLibrary @libParams
167+
$script:libraryCache = Get-PatLibrary @libraryParameters
168168
}
169169
if ($script:libraryCache -and $script:libraryCache.Directory) {
170170
$lib = $script:libraryCache.Directory | Where-Object { [int]$_.key -eq $libId }
@@ -231,12 +231,12 @@ function Get-PatCollection {
231231

232232
if ($LibraryName -or $LibraryId) {
233233
if (-not $script:libraryCache) {
234-
$libParams = @{ ErrorAction = 'Stop' }
234+
$libraryParameters = @{ ErrorAction = 'Stop' }
235235
if ($script:serverContext.WasExplicitUri) {
236-
$libParams['ServerUri'] = $effectiveUri
237-
if ($script:serverContext.Token) { $libParams['Token'] = $script:serverContext.Token }
236+
$libraryParameters['ServerUri'] = $effectiveUri
237+
if ($script:serverContext.Token) { $libraryParameters['Token'] = $script:serverContext.Token }
238238
}
239-
$script:libraryCache = Get-PatLibrary @libParams
239+
$script:libraryCache = Get-PatLibrary @libraryParameters
240240
}
241241

242242
if ($LibraryName) {
@@ -258,12 +258,12 @@ function Get-PatCollection {
258258
else {
259259
# No library specified - get all libraries
260260
if (-not $script:libraryCache) {
261-
$libParams = @{ ErrorAction = 'Stop' }
261+
$libraryParameters = @{ ErrorAction = 'Stop' }
262262
if ($script:serverContext.WasExplicitUri) {
263-
$libParams['ServerUri'] = $effectiveUri
264-
if ($script:serverContext.Token) { $libParams['Token'] = $script:serverContext.Token }
263+
$libraryParameters['ServerUri'] = $effectiveUri
264+
if ($script:serverContext.Token) { $libraryParameters['Token'] = $script:serverContext.Token }
265265
}
266-
$script:libraryCache = Get-PatLibrary @libParams
266+
$script:libraryCache = Get-PatLibrary @libraryParameters
267267
}
268268

269269
if ($script:libraryCache -and $script:libraryCache.Directory) {

PlexAutomationToolkit/Public/Get-PatLibraryChildItem.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,9 @@ function Get-PatLibraryChildItem {
110110
$sections = Get-PatLibrary -ErrorAction 'Stop'
111111
}
112112
else {
113-
$libParams = @{ ServerUri = $effectiveUri; ErrorAction = 'Stop' }
114-
if ($Token) { $libParams['Token'] = $Token }
115-
$sections = Get-PatLibrary @libParams
113+
$libraryParameters = @{ ServerUri = $effectiveUri; ErrorAction = 'Stop' }
114+
if ($Token) { $libraryParameters['Token'] = $Token }
115+
$sections = Get-PatLibrary @libraryParameters
116116
}
117117

118118
$matchingSection = $null

0 commit comments

Comments
 (0)