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

Change Channel to Source #12

Merged
merged 13 commits into from
Feb 2, 2024
Merged

Change Channel to Source #12

merged 13 commits into from
Feb 2, 2024

Conversation

kieraneglin
Copy link
Owner

@kieraneglin kieraneglin commented Feb 2, 2024

What's new?

  • Adds field collection_type to new Source model. This will specify whether the source covers a playlist or a channel.

What's changed?

  • Replaces Channel model with near-identical Source model
    • I had this as Channel initially because I thought that playlists were sufficiently different to justify living in their own model. As I got further in and realized all customization happened around the Channel model (ie: options exist at either the MediaItem or MediaProfile level - not the Channel level), I realized that this really only stores one useful bit of info (the channel's ID) and the rest was non-essential metadata. Knowing that, I thought it'd save me some headache to combine the two into a singular Source model which I will expand on in future PRs
  • Changes channel_id field name to collection_id. NOT naming it source_id because that's way too confusing since source_id implies it tracks something internal to the app (like a source), but really it tracks the YouTube ID
  • Updates non-repo channel-based modules to be based around sources instead. Practically, this means renaming lots of *Channel* modules, *channel* methods, and *channel* directory/filepaths to use Source/source instead. Did the same with variable names and comments
  • Removed lib/pinchflat/media_client/backends/yt_dlp/channel.ex in favour of just using lib/pinchflat/media_client/backends/yt_dlp/video_collection.ex

What's fixed?

N/A

Any other comments?

Apart from the renaming, this PR doesn't really do anything (save for adding the collection_type attribute which I saw as necessary groundwork BUT it performs no function). This is because I wanted to separate out any meaningful logic changes into a PR with less noise and keep this scoped to the bare-minimum related to the rename.

Instead of naming the channels table and dealing with all the indexes/FKs/whatever, I decided to just nuke it and start fresh. Such is the luxury of working with a pre-release app!

@kieraneglin kieraneglin self-assigned this Feb 2, 2024
@kieraneglin kieraneglin merged commit bdef6c7 into master Feb 2, 2024
1 check passed
@kieraneglin kieraneglin deleted the ke/change-channel-to-source branch February 2, 2024 18:45
kieraneglin added a commit that referenced this pull request Mar 29, 2024
* Ensure channel detail lookup doesn't download the video - oops

* Ran the needful migrations for replacing channels with sources

* got media source test back working

* channel tasks test

* Media indexing worker test

* media tests

* Got all tests working except controller tests

* got all tests working

* Renamed Channel struct to Source

* renamed ChannelTasks

* More renaming; renamed channel details module

* Removed Channel yt-dlp module, instead throwing things in the VideoCollection module

* Renamed what looks like the last of the outstanding data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant