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

Start work on offline download support #1065

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

BenStokmans
Copy link

This PR was inspired by @JacobKingDev. It improves upon the current framework for media downloading provided by @LePips. It is far from finished, and I intended to improve on it in the coming weeks. I would love any feedback, as this is the first time I'm working with Swift, so my code is probably riddled with nonsensical rubbish. That being said here is a list of the changes I've implemented.

  • Fixed negative percentage with progress text while downloading (the way I get the excepted size is kind of hacky, I would love pointers on how to improve it)
  • Improved design of download list view
  • Added size label to download item view (added extension to the FixedWidthInteger extension)
  • Added temporary OfflineTabCoordinator for testing I'll try to integrate it with the MainTabCoordinator ASAP
  • Changed the default behaviour when a NSURLErrorNotConnectedToInternet to showing a view using the OffileTabCoordinator.
  • Added the ability to remove downloaded media

@LePips
Copy link
Member

LePips commented May 23, 2024

I'm glad that this is able to pick up starting from my latest work, but is there a reason why we didn't ask on the previous draft PR to continue the work elsewhere?

@BenStokmans
Copy link
Author

I'm sorry I don't quite understand what you mean by:

but is there a reason why we didn't ask on the previous draft PR to continue the work elsewhere?

@LePips
Copy link
Member

LePips commented May 23, 2024

There is already a pre-existing PR for working on downloads. While it has been a while since work was done on it, and that's okay, now we have 2 PRs for the same feature.

I'm going to have to ask you to communicate with @JacobKingDev about taking over the feature, or at the very least it would have been nice ask if there was interest to continue the previous work. Even if after a few days there isn't an answer, then another PR would have been fine.

@BenStokmans
Copy link
Author

@LePips I have asked in the previous PR, but I'm yet to get a response. In a mean time, I've completed a very rough version of my idea of the downloads section. It can be enabled in the experiments section, and I'd love some feedback on how you think it looks and feels. The code for the UI is largely a verbatim copy of the ItemView group (there is a lot of duplicate code that can be removed) the reason I did it like this is I wanted to match the current design as much as possible. If you have any feedback on the rest of the code or the way I've decided to handle the downloads, please let me know.

What currently works:

  • Downloading any episode or film
  • Both online and offline playback of downloaded media
  • Properly grouping episodes on season and series
  • Resume items, Next up items and adjacent items for downloaded media

What doesn't work (yet) / what I haven't got around to:

  • Playback progress syncing
  • Estimated time left on download
  • Batch downloading (e.g. season)
  • Proper support for different users
  • Picking specific media source

@LePips
Copy link
Member

LePips commented May 30, 2024

It will take me a while to look at this as I work on the video player again. Due to that, I see that some things will probably have to be rewritten, but I don't anticipate it to be too much. I will also have to think a lot about the overall architecture that my initial work had and whether it needs to be redone.

@chickdan
Copy link
Contributor

chickdan commented Jun 9, 2024

With two forks already and multiple folks wanting to pitch in (myself included), I think it would be helpful to have these PRs put into a feature branch until it's ready for main. Ideally we will see smaller change-sets, too.

@BenStokmans
Copy link
Author

@chickdan I would like that. If you want to make a feature branch, I would be happy to contribute.

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.

None yet

3 participants