MCPcopy Index your code
hub / github.com/Threadfin/Threadfin / buildDatabaseDVR

Function buildDatabaseDVR

src/data.go:770–1088  ·  view source on GitHub ↗

Datenbank für das DVR System erstellen

()

Source from the content-addressed store, hash-verified

768
769// Datenbank für das DVR System erstellen
770func buildDatabaseDVR() (err error) {
771
772 // Don't send progress updates here - they're handled by the calling function
773 // This prevents conflicts with the main progress tracking
774
775 Data.Streams.All = make([]interface{}, 0, System.UnfilteredChannelLimit)
776 Data.Streams.Active = make([]interface{}, 0, System.UnfilteredChannelLimit)
777 Data.Streams.Inactive = make([]interface{}, 0, System.UnfilteredChannelLimit)
778 Data.Playlist.M3U.Groups.Text = []string{}
779 Data.Playlist.M3U.Groups.Value = []string{}
780 Data.StreamPreviewUI.Active = []string{}
781 Data.StreamPreviewUI.Inactive = []string{}
782
783 var availableFileTypes = []string{"m3u", "hdhr"}
784
785 var tmpGroupsM3U = make(map[string]int64)
786
787 err = createFilterRules()
788 if err != nil {
789 return
790 }
791
792 // Calculate total channels for progress tracking
793 totalChannels := 0
794 for _, fileType := range availableFileTypes {
795 playlistFile := getLocalProviderFiles(fileType)
796 for _, i := range playlistFile {
797 channels, _ := parsePlaylist(i, fileType)
798 totalChannels += len(channels)
799 }
800 }
801
802 // Reset for actual processing
803 Data.Streams.All = make([]interface{}, 0, System.UnfilteredChannelLimit)
804 Data.Streams.Active = make([]interface{}, 0, System.UnfilteredChannelLimit)
805 Data.Streams.Inactive = make([]interface{}, 0, System.UnfilteredChannelLimit)
806 Data.Playlist.M3U.Groups.Text = []string{}
807 Data.Playlist.M3U.Groups.Value = []string{}
808 Data.StreamPreviewUI.Active = []string{}
809 Data.StreamPreviewUI.Inactive = []string{}
810
811 processedChannels := 0
812
813 for _, fileType := range availableFileTypes {
814
815 var playlistFile = getLocalProviderFiles(fileType)
816
817 for n, i := range playlistFile {
818
819 var channels []interface{}
820 var groupTitle, tvgID, uuid int = 0, 0, 0
821 var keys = []string{"group-title", "tvg-id", "uuid"}
822 var compatibility = make(map[string]int)
823
824 var id = strings.TrimSuffix(getFilenameFromPath(i), path.Ext(getFilenameFromPath(i)))
825 var playlistName = getProviderParameter(id, fileType, "name")
826
827 // Check file size for progress reporting

Callers 10

ShowSystemInfoFunction · 0.85
maintenanceFunction · 0.85
updateServerSettingsFunction · 0.85
saveFilesFunction · 0.85
updateFileFunction · 0.85
saveFilterFunction · 0.85
saveWizardFunction · 0.85
processStartupWorkflowFunction · 0.85
APIFunction · 0.85
updateUrlsJsonFunction · 0.85

Calls 14

createFilterRulesFunction · 0.85
getLocalProviderFilesFunction · 0.85
parsePlaylistFunction · 0.85
getProviderParameterFunction · 0.85
showInfoFunction · 0.85
ShowErrorFunction · 0.85
showDebugFunction · 0.85
broadcastProgressUpdateFunction · 0.85
minFunction · 0.85
extractSeasonEpisodeFunction · 0.85
filterThisStreamFunction · 0.85
setProviderCompatibilityFunction · 0.85

Tested by

no test coverage detected