Repository navigation
add support for -containsSyntheticMedia - #210
Conversation
| notifySubscribers := flag.Bool("notify", true, "notify channel subscribers of new video. Specify '-notify:=false' to disable.") | ||
| debug := flag.Bool("debug", false, "turn on verbose log output") | ||
| sendFileName := flag.Bool("sendFilename", true, "send original file name to YouTube") | ||
| containsSyntheticMedia := flag.Bool("containsSyntheticMedia", false, "video contains synthetic media") |
There was a problem hiding this comment.
I would prefer not to add any more flags that relate to video metadata, and instead leave those kinds of things in the metadata JSON file only. At some point in the future I may overhaul the cli and include every option as a flag. For now, please remove this flag.
There was a problem hiding this comment.
Removed :-)
Please check.
| SendFileName: *sendFileName, | ||
| PlaylistIDs: playlistIDs, | ||
| RecordingDate: recordingDate, | ||
| ContainsSyntheticMedia: *containsSyntheticMedia, |
There was a problem hiding this comment.
Please remove (see earlier comment about flags).
There was a problem hiding this comment.
Removed :-)
Please check.
| func TestContainsSyntheticMedia(t *testing.T) { | ||
| url, err := url.Parse(testServer.URL) | ||
| if err != nil { | ||
| log.Fatal(err) | ||
| } | ||
|
|
||
| transport := &mockTransport{url: url} | ||
| limitTransport, err := limiter.NewLimitTransport(transport, limiter.LimitRange{}, fileSize, 0) | ||
| if err != nil { | ||
| t.Fatal(err) | ||
| } | ||
| config.ContainsSyntheticMedia = true | ||
| ctx := context.Background() | ||
| videoReader := &mockReader{fileSize: fileSize} | ||
| defer videoReader.Close() | ||
|
|
||
| err = yt.Run(ctx, limitTransport, config, videoReader) | ||
| if err != nil { | ||
| log.Fatal(err) | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
I appreciate you making the effort to create a test, however this test doesn't really achieve anything useful. Please remove it. (I don't think it's really necessary to have tests for all the video properties)
There was a problem hiding this comment.
You're totally right, sorry about this brain cramp, removed :)
| NotifySubscribers bool | ||
| SendFileName bool | ||
| RecordingDate Date | ||
| ContainsSyntheticMedia bool |
There was a problem hiding this comment.
Please remove (see earlier comment about flags).
There was a problem hiding this comment.
Removed :)
Please check.
| PublicStatsViewable bool `json:"publicStatsViewable,omitempty"` | ||
| PublishAt Date `json:"publishAt,omitempty"` | ||
| MadeForKids bool `json:"madeForKids,omitempty"` | ||
| ContainsSyntheticMedia *bool `json:"containsSyntheticMedia,omitempty"` |
There was a problem hiding this comment.
Please change this to not be a pointer.
There was a problem hiding this comment.
Changed. Please check :)
| if config.ContainsSyntheticMedia { | ||
| video.Status.ContainsSyntheticMedia = true | ||
| } | ||
|
|
There was a problem hiding this comment.
Please remove (see earlier comment about flags).
There was a problem hiding this comment.
Done, please check :)
| if videoMeta.PublicStatsViewable { | ||
| video.Status.PublicStatsViewable = videoMeta.PublicStatsViewable | ||
| } | ||
| if videoMeta.ContainsSyntheticMedia != nil { |
There was a problem hiding this comment.
This shouldn't be a pointer. Instead use if videoMeta.ContainsSyntheticMedia {. Also, please update the example metadata JSON in the README to include this option.
There was a problem hiding this comment.
Changed to match MadeForKids logic. Also added example to README.md. Please check :)
Add support for -containsSyntheticMedia via CLI or via JSON (with -metaJSON flag).
In the backend will add the flag to status.containsSyntheticMedia.