Skip to content

Commit

Permalink
Fix parsing of marker CSVs that have escape chars
Browse files Browse the repository at this point in the history
  • Loading branch information
jerodsanto committed Jan 23, 2025
1 parent 4b67960 commit 2f54034
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/changelog/kits/marker_kit.ex
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
defmodule Changelog.Kits.MarkerKit do
alias ChangelogWeb.TimeView
NimbleCSV.define(CsvParser, separator: "\t", escape: "\"")
NimbleCSV.define(CsvParser, separator: "\t", escape: "\\")

# Name Start Duration Time Format Type Description
def to_youtube(string) do
Expand Down
10 changes: 10 additions & 0 deletions test/changelog/kits/marker_kit_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,15 @@ defmodule Changelog.MarkerKitTest do

assert MarkerKit.to_youtube(csv) == String.trim(desired)
end

test "works for Iterviews 625" do
[csv, desired] =
"/markers/interviews-625.csv"
|> fixtures_path()
|> File.read!()
|> String.split("---")

assert MarkerKit.to_youtube(csv) == String.trim(desired)
end
end
end
38 changes: 38 additions & 0 deletions test/fixtures/markers/interviews-625.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
Name Start Duration Time Format Type Description
Start the show! 00:00:00:00 00:00:00:00 24 fps Cue
Let's go way back 00:04:50:08 00:00:00:00 24 fps Cue
Getting people to use your open source 00:12:22:00 00:00:00:00 24 fps Cue
Mundane and boring 00:20:55:22 00:00:00:00 24 fps Cue
Landing large org users 00:22:00:16 00:00:00:00 24 fps Cue
Not serious business here 00:27:12:04 00:00:00:00 24 fps Cue
If it fits on a credit card 00:30:03:00 00:00:00:00 24 fps Cue
How did the acquisition go down? 00:40:57:08 00:00:00:00 24 fps Cue
Going off the rails 00:43:10:10 00:00:00:00 24 fps Cue
Call me "Daddy pig" 00:45:38:14 00:00:00:00 24 fps Cue
Benthos just went away 00:48:30:14 00:00:00:00 24 fps Cue
Now it's open core 00:51:42:12 00:00:00:00 24 fps Cue
Was this a rug pull? 00:57:22:02 00:00:00:00 24 fps Cue
What's the alternate universe? 01:08:07:10 00:00:00:00 24 fps Cue
Did Synadia miss out? 01:14:27:06 00:00:00:00 24 fps Cue
Overlapping user bases 01:16:35:00 00:00:00:00 24 fps Cue
I'm just gonna play video games now 01:20:36:14 00:00:00:00 24 fps Cue
Healthy open source habits 01:33:47:10 00:00:00:00 24 fps Cue
---
00:00 Start the show!
04:50 Let's go way back
12:22 Getting people to use your open source
20:55 Mundane and boring
22:00 Landing large org users
27:12 Not serious business here
30:03 If it fits on a credit card
40:57 How did the acquisition go down?
43:10 Going off the rails
45:38 Call me "Daddy pig"
48:30 Benthos just went away
51:42 Now it's open core
57:22 Was this a rug pull?
1:08:07 What's the alternate universe?
1:14:27 Did Synadia miss out?
1:16:35 Overlapping user bases
1:20:36 I'm just gonna play video games now
1:33:47 Healthy open source habits

0 comments on commit 2f54034

Please sign in to comment.