sbondCo / Watcharr

Open source, self-hostable watched list for all your content (movies, tv series, anime, games) with user authentication, modern and clean UI and a very simple setup.
https://watcharr.app
MIT License
534 stars 22 forks source link

Feature: Import of TodoMovies #613

Closed AlexPerathoner closed 2 months ago

AlexPerathoner commented 2 months ago

I've been using TodoMovies (https://todomovies.app/) to track my watch list and wanted to switch to Watcharr. I've noticed that there isn't an option for importing the csv exported by such app and I'm willing to look into implementing it myself.

I've noticed in CONTRIBUTING you suggest discussing PRs first, so here we are: is this something you'd be happy to find added? Anything I should pay attention to?

Related to #429

IRHM commented 2 months ago

Hi @AlexPerathoner, thank you for opening this issue and thanks for offering to work on it, that would be great!

If it's just a generic csv file exported from TodoMovies, then you could likely copy some of the code used for other importing methods and change it around to work with the specific csv format from TodoMovies.

For importing files, the current process is goes like so: drop file into watcharr, the client parses it and displays the content in a table, then the user starts the import and a generic import route is called for each show/movie with the relevant data to complete the import.

This rough guide should help you get started:

  1. Add a new button for TodoMovies and make it go to a new function which reads the csv and stores its data in import/+page.svelte.
  2. Get the loaded file data and parse it so that it conforms to the ImportedList[] type (adds to rList variable) in import/process/+page.svelte.
  3. The start import button should work now on the process page under the populated table.

Hopefully that helps you out and it goes smoothly. You should be able to just copy one of the functions in those files and change them around for this app.

Let me know if you have any questions! Thanks!

Oh and p.s. the package papaparse for parsing csv is already a dependency for the client, so you could use that straight away: https://www.papaparse.com/docs (theres existing function calls that parse csv in those import files too if you want to copy them over)

AlexPerathoner commented 2 months ago

Thanks, much more detailed instructions that I could've hoped for. How did you create the svg icons? Did you generate them with a particular tool or did you do it by hand?

AlexPerathoner commented 2 months ago

Some updates:

IRHM commented 2 months ago

Hey @AlexPerathoner thanks for the updates:

  1. I just take the icons from the respective project, that should be okay.
  2. Yeah that is fine, should be easier for you if its JSON. I don't think the generic /import route supports adding the movie/show to a tag, you could add support for it or just use the create tag/add to tag routes directly instead.
  3. You're right, if you have the tmdbId, then you don't have to bother with setting the year (that just helps if searching only via name of content). You don't have to bother with adding a dropdown, I would think anyone importing would just let the logic decide based on their export.