fix ticktick migration, still need to update test to match
continuous-integration/drone/pr Build is passing Details

This commit is contained in:
kooshi 2023-01-05 20:31:15 -06:00
parent dd7dcdd0cc
commit af9faad25a
1 changed files with 21 additions and 21 deletions

View File

@ -197,60 +197,60 @@ func (m *Migrator) Migrate(user *user.User, file io.ReaderAt, size int64) error
continue
}
priority, err := strconv.Atoi(record[10])
priority, err := strconv.Atoi(record[11])
if err != nil {
return err
}
order, err := strconv.ParseFloat(record[14], 64)
order, err := strconv.ParseFloat(record[15], 64)
if err != nil {
return err
}
taskID, err := strconv.ParseInt(record[21], 10, 64)
taskID, err := strconv.ParseInt(record[22], 10, 64)
if err != nil {
return err
}
parentID, err := strconv.ParseInt(record[21], 10, 64)
parentID, err := strconv.ParseInt(record[23], 10, 64)
if err != nil {
return err
parentID = 0
}
reminder := parseDuration(record[8])
reminder := parseDuration(record[9])
t := &tickTickTask{
ListName: record[1],
Title: record[2],
Tags: strings.Split(record[3], ", "),
Content: record[4],
IsChecklist: record[5] == "Y",
Tags: strings.Split(record[4], ", "),
Content: record[5],
IsChecklist: record[6] == "Y",
Reminder: reminder,
Repeat: record[9],
Repeat: record[7],
Priority: priority,
Status: record[11],
Status: record[12],
Order: order,
TaskID: taskID,
ParentID: parentID,
}
if record[6] != "" {
t.StartDate, err = time.Parse(timeISO, record[6])
if err != nil {
return err
}
}
if record[7] != "" {
t.DueDate, err = time.Parse(timeISO, record[7])
t.StartDate, err = time.Parse(timeISO, record[7])
if err != nil {
return err
}
}
if record[12] != "" {
t.StartDate, err = time.Parse(timeISO, record[12])
if record[8] != "" {
t.DueDate, err = time.Parse(timeISO, record[8])
if err != nil {
return err
}
}
if record[13] != "" {
t.CompletedTime, err = time.Parse(timeISO, record[13])
t.StartDate, err = time.Parse(timeISO, record[13])
if err != nil {
return err
}
}
if record[14] != "" {
t.CompletedTime, err = time.Parse(timeISO, record[14])
if err != nil {
return err
}