(stream ThisStream)
| 667 | } |
| 668 | |
| 669 | func clientConnection(stream ThisStream) (status bool) { |
| 670 | |
| 671 | status = true |
| 672 | Lock.Lock() |
| 673 | defer Lock.Unlock() |
| 674 | |
| 675 | if _, ok := BufferClients.Load(stream.PlaylistID + stream.MD5); !ok { |
| 676 | |
| 677 | var debug = fmt.Sprintf("Streaming Status:Remove temporary files (%s)", stream.Folder) |
| 678 | showDebug(debug, 1) |
| 679 | |
| 680 | status = false |
| 681 | |
| 682 | debug = fmt.Sprintf("Remove tmp folder:%s", stream.Folder) |
| 683 | showDebug(debug, 1) |
| 684 | |
| 685 | if err := bufferVFS.RemoveAll(stream.Folder); err != nil { |
| 686 | ShowError(err, 4005) |
| 687 | } |
| 688 | |
| 689 | if p, ok := BufferInformation.Load(stream.PlaylistID); !ok { |
| 690 | |
| 691 | showInfo(fmt.Sprintf("Streaming Status:Channel: %s - No client is using this channel anymore. Streaming Server connection has ended", stream.ChannelName)) |
| 692 | |
| 693 | if p != nil { |
| 694 | var playlist = p.(Playlist) |
| 695 | |
| 696 | showInfo(fmt.Sprintf("Streaming Status:Playlist: %s - Tuner: %d / %d", playlist.PlaylistName, len(playlist.Streams), playlist.Tuner)) |
| 697 | |
| 698 | if len(playlist.Streams) <= 0 { |
| 699 | BufferInformation.Delete(stream.PlaylistID) |
| 700 | } |
| 701 | } |
| 702 | |
| 703 | } |
| 704 | |
| 705 | status = false |
| 706 | |
| 707 | } |
| 708 | |
| 709 | return |
| 710 | } |
| 711 | |
| 712 | func parseM3U8(stream *ThisStream) (err error) { |
| 713 |
no test coverage detected