Check url.Parse error
This commit is contained in:
@@ -102,11 +102,14 @@ func (p *NewScreen) InterInit(tv *soapcalls.TVPayload, c chan error) {
|
||||
}()
|
||||
|
||||
p.mu.Lock()
|
||||
p.mediaTitle = tv.MediaURL
|
||||
|
||||
mediaTitlefromURL, err := url.Parse(tv.MediaURL)
|
||||
if err == nil {
|
||||
p.mediaTitle = strings.TrimLeft(mediaTitlefromURL.Path, "/")
|
||||
if err != nil {
|
||||
c <- fmt.Errorf("interactive screen error: %w", err)
|
||||
return
|
||||
}
|
||||
p.mediaTitle = strings.TrimLeft(mediaTitlefromURL.Path, "/")
|
||||
|
||||
p.mu.Unlock()
|
||||
|
||||
encoding.Register()
|
||||
|
@@ -250,12 +250,13 @@ func setAVTransportSoapBuild(mediaURL, mediaType, subtitleURL string, transcode,
|
||||
class = "object.item.videoItem.movie"
|
||||
}
|
||||
|
||||
mediaTitle := mediaURL
|
||||
mediaTitlefromURL, err := url.Parse(mediaURL)
|
||||
if err == nil {
|
||||
mediaTitle = strings.TrimLeft(mediaTitlefromURL.Path, "/")
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("setAVTransportSoapBuild url parse error: %w", err)
|
||||
}
|
||||
|
||||
mediaTitle := strings.TrimLeft(mediaTitlefromURL.Path, "/")
|
||||
|
||||
re, err := regexp.Compile(`[&<>\\]+`)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("setAVTransportSoapBuild regex compile error: %w", err)
|
||||
|
Reference in New Issue
Block a user