fix Id duplicates

This commit is contained in:
Arnas Udovicius 2022-08-01 17:16:56 +03:00
parent 8ea36234a9
commit 7ed3c128f4

View file

@ -243,7 +243,7 @@ func addMissingId(dir string, id int64) error {
scanner.Split(bufio.ScanLines)
for scanner.Scan() {
line := scanner.Text()
if strings.HasPrefix(line, "id:") {
if strings.HasPrefix(line, "* id:") {
break
}
if line == "---" {
@ -299,8 +299,8 @@ func getMaxId(dir string) (int64, error) {
break
}
if strings.HasPrefix(line, "id:") {
line = strings.TrimPrefix(line, "id:")
if strings.HasPrefix(line, "* id:") {
line = strings.TrimPrefix(line, "* id:")
i := abcex.Decode(strings.Trim(line, " "))
if i > max {
max = i