Skip to content

Commit e1b6f09

Browse files
committed
dd_progid is only created if needed
1 parent d3b9eb4 commit e1b6f09

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

src/config.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
)
1515

1616
const AppName = "guide2go"
17-
const Version = "1.0.5"
17+
const Version = "1.0.6"
1818

1919
var Config = make(map[string]interface{}) // Configuartion Map
2020
var Cache = make(map[string]interface{}) // Cache Map

src/xmltv.go

+15-11
Original file line numberDiff line numberDiff line change
@@ -316,22 +316,26 @@ func getEpisodeNumSystem(programmID string) (err error, program Program) {
316316

317317
}
318318

319-
switch programmID[0:2] {
319+
if seaseon > 0 && episode > 0 {
320+
program.EpisodeNums = append(program.EpisodeNums, EpisodeNum{Value: fmt.Sprintf("S%d E%d", seaseon, episode), System: "onscreen"})
321+
}
320322

321-
case "EP":
322-
value = programmID[0:10] + "." + programmID[10:]
323+
if len(program.EpisodeNums) == 0 {
323324

324-
case "SH", "MV":
325-
value = programmID[0:10] + ".0000"
325+
switch programmID[0:2] {
326326

327-
default:
328-
value = programmID
329-
}
327+
case "EP":
328+
value = programmID[0:10] + "." + programmID[10:]
330329

331-
program.EpisodeNums = append(program.EpisodeNums, EpisodeNum{Value: value, System: "dd_progid"})
330+
case "SH", "MV":
331+
value = programmID[0:10] + ".0000"
332+
333+
default:
334+
value = programmID
335+
}
336+
337+
program.EpisodeNums = append(program.EpisodeNums, EpisodeNum{Value: value, System: "dd_progid"})
332338

333-
if seaseon > 0 && episode > 0 {
334-
program.EpisodeNums = append(program.EpisodeNums, EpisodeNum{Value: fmt.Sprintf("S%d E%d", seaseon, episode), System: "onscreen"})
335339
}
336340

337341
if len(p.OriginalAirDate) > 0 {

0 commit comments

Comments
 (0)