|
6 | 6 | "log" |
7 | 7 | "os" |
8 | 8 | "path" |
| 9 | + "sort" |
9 | 10 | "strings" |
10 | 11 | "time" |
11 | 12 |
|
@@ -40,13 +41,22 @@ func main() { |
40 | 41 | } |
41 | 42 | logger.Printf("%d recording%s found", recordings.TotalRecords, pluralize(recordings.TotalRecords)) |
42 | 43 | for _, meeting := range recordings.Meetings { |
43 | | - fmt.Printf("%s %d %s\n", meeting.StartTime.Format("2006-01-02"), meeting.ID, meeting.Topic) |
44 | | - for _, f := range meeting.RecordingFiles { |
| 44 | + fmt.Printf("%s %d %q\n", meeting.StartTime.Format("2006-01-02"), meeting.ID, meeting.Topic) |
| 45 | + recs := make(map[string]*zoom.RecordingFile, len(meeting.RecordingFiles)) |
| 46 | + recTypes := make([]string, 0, len(meeting.RecordingFiles)) |
| 47 | + for i, f := range meeting.RecordingFiles { |
45 | 48 | typ := f.RecordingType |
46 | 49 | if typ == "" { |
47 | 50 | typ = f.FileType |
48 | 51 | } |
49 | | - fmt.Printf("\t%s %s\n", strings.ToLower(typ), f.DownloadURL) |
| 52 | + uniqType := fmt.Sprintf("%s|%d", strings.ToLower(typ), i) |
| 53 | + capture := f |
| 54 | + recs[uniqType] = &capture |
| 55 | + recTypes = append(recTypes, uniqType) |
| 56 | + } |
| 57 | + sort.Strings(recTypes) |
| 58 | + for _, typ := range recTypes { |
| 59 | + fmt.Printf(" %-32s %s\n", typ[:strings.LastIndex(typ, "|")], recs[typ].DownloadURL) |
50 | 60 | } |
51 | 61 | } |
52 | 62 | } |
0 commit comments