Skip to content

Commit

Permalink
feat: SoundCloud Source - Defaulting Name ( Fixes #179 )
Browse files Browse the repository at this point in the history
  • Loading branch information
James Brundage committed Feb 14, 2024
1 parent 25bef61 commit f7c9d78
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions Commands/Sources/Set-OBSSoundCloudSource.ps.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,12 @@ function Set-OBSSoundCloudSource
# The name of the scene.
# If no scene name is provided, the current program scene will be used.
[Parameter(ValueFromPipelineByPropertyName)]
[Alias('SceneName')]
[string]
$Scene,

# The name of the input.
# If no name is provided, the last segment of the URI or file path will be the input name.
# If no name is provided, then "SoundCloud" will be used.
[Parameter(ValueFromPipelineByPropertyName)]
[Alias('InputName','SourceName')]
[string]
Expand Down Expand Up @@ -279,14 +280,7 @@ function Set-OBSSoundCloudSource
$myParameterData["is_local_file"] = $true

if (-not $Name) {
$Name = $myParameters['Name'] =
if ($uri.Segments) {
$uri.Segments[-1] -replace '\.html$'
} elseif ($uri -match '[\\/]') {
@($uri -split '[\\/]')[-1]
} else {
$uri
}
$Name = $myParameters['Name'] = 'SoundCloud'
}

$addSplat = [Ordered]@{
Expand Down

0 comments on commit f7c9d78

Please sign in to comment.