File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,9 @@ module Airtable
45
45
function update! (baseId, sheetId, records)
46
46
for part in Iterators. partition (records, 10 )
47
47
resp = patch (baseId, sheetId, Dict (:records => part))
48
- @show resp
48
+ if resp. status != 200
49
+ @warn " Update failed" baseId sheetId part
50
+ end
49
51
end
50
52
end
51
53
end
Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ include("Youtube.jl")
4
4
client = load_or_obtain ()
5
5
refresh! (client)
6
6
7
+ const EPOCH = 2
8
+
7
9
const baseId = " appAeQFpa0ywisJKd"
8
10
const sheet1Id = " tblube5UaXuYqPzDq"
9
11
38
40
function update_metadata (client, table)
39
41
for record in table
40
42
fields = record[:fields ]
43
+ epoch = fields[Symbol (" Epoch" )]
41
44
pretalx_id = fields[Symbol (" Pretalx ID" )]
45
+ if epoch >= EPOCH
46
+ @info " Skipping..." pretalx_id epoch
47
+ end
48
+ if ! haskey (fields, Symbol (" Youtube ID" ))
49
+ continue
50
+ end
42
51
yt_id = Base. get (fields, Symbol (" Youtube ID" ), nothing )
43
52
44
53
if yt_id === nothing
@@ -66,11 +75,24 @@ function update_metadata(client, table)
66
75
:description => yt_desc,
67
76
:categoryId => " 28" ,
68
77
),
78
+ :status => Dict (
79
+ :privacyStatus => " unlisted" ,
80
+ :selfDeclaredMadeForKids => false ,
81
+ :embeddable => true
82
+ ),
69
83
)
70
84
71
85
resp = video_update! (client, yt_id, parts)
72
86
if resp. status != 200
73
87
@warn " Update failed" pretalx_id resp
88
+ else
89
+ new_record = Dict (
90
+ :id => record[:id ],
91
+ :fields => Dict (
92
+ " Epoch" => EPOCH,
93
+ )
94
+ )
95
+ Airtable. update! (baseId, sheet1Id, [new_record])
74
96
end
75
97
end
76
98
end
You can’t perform that action at this time.
0 commit comments