Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix video titles in JSON format #95

Merged
merged 1 commit into from
Jan 9, 2021

Conversation

strager
Copy link
Contributor

@strager strager commented Jun 6, 2020

When using the json format, video titles have characters such as : and ' stripped:

$ tcd --video 497919915 --format json
code review: dlloverflow's VPNMonitor (Python)
[json] ./497919915.json
$ jq .video.title 497919915.json
"code review dlloverflows VPNMonitor (Python)"

This happens because Pipe.output (called on tcd/downloader.py line 92) mutates video.data before it's written to the JSON file.

Fix the bug by making Pipe.output not mutate its parameter object:

$ python -m tcd --video 497919915 --format json
code review: dlloverflow's VPNMonitor (Python)
[json] ./497919915.json

$ jq .video.title 497919915.json
"code review: dlloverflow's VPNMonitor (Python)"

When using the `json` format, video titles have characters such as `:`
and `'` stripped:

    $ tcd --video 497919915 --format json
    code review: dlloverflow's VPNMonitor (Python)
    [json] ./497919915.json
    $ jq .video.title 497919915.json
    "code review dlloverflows VPNMonitor (Python)"

This happens because Pipe.output (called on tcd/downloader.py line 92)
mutates video.data before it's written to the JSON file.

Fix the bug by making Pipe.output not mutate its parameter object:

    $ python -m tcd --video 497919915 --format json
    code review: dlloverflow's VPNMonitor (Python)
    [json] ./497919915.json

    $ jq .video.title 497919915.json
    "code review: dlloverflow's VPNMonitor (Python)"
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jun 6, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@PetterKraabol PetterKraabol merged commit 07861ff into PetterKraabol:master Jan 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants