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

Options to sync one way or the other #4

Closed
bbakermmc opened this issue Nov 12, 2019 · 15 comments · Fixed by #462
Closed

Options to sync one way or the other #4

bbakermmc opened this issue Nov 12, 2019 · 15 comments · Fixed by #462
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@bbakermmc
Copy link

It would be nice to configure the syncing ways. Maybe I want to update track from one server but not pull the tracking down, etc. Also option to toggle TV or Movies

@Taxel Taxel added the enhancement New feature or request label Nov 13, 2019
@Taxel
Copy link
Owner

Taxel commented Nov 16, 2019

I added some more config options and pushed them to the branch new-features
This does not contain the option for TV shows or Movies individually, though.
Could you try it out, see if it works and propose how I could structure the config files to allow selecting only movies or only shows without making the config too hard to understand?

@bbakermmc
Copy link
Author

Im the worst person to ask if someone can understand a config file lol. Im a Sr Software Eng lol. But in .Net/Sql :) I think python is so horrid with its tab/space formatting.

I pulled it down and is running now. Ill see what errors I get. Its not any faster thats for sure :P

{
    "base_url": "xxxx",
    "log_debug_messages": true,
    "sync": {
        "trakt_to_plex": {
            "liked_lists": false,
            "watchlist": false,
            "watched_status": false,
            "ratings": false
        },
        "plex_to_trakt": {
            "watched_status": true,
            "collection": false,
            "ratings": false
        }
    },
    "xbmc-providers": {
        "movies": "imdb",
        "shows": "tvdb"
    }
}

@bbakermmc
Copy link
Author

The decoder hates me: Maybe try catch this, otherwise it stops the entire process.


Processing section Kids TV
Traceback (most recent call last):
  File "C:/Users/bradl/Desktop/PlexTraktSync-master/main.py", line 176, in process_show_section
    trakt_collected = pytrakt_extensions.collected(trakt_show.slug)
  File "C:\Program Files (x86)\Python38-32\lib\site-packages\trakt\core.py", line 472, in inner
    json_data = self._handle_request('get', url)
  File "C:\Program Files (x86)\Python38-32\lib\site-packages\trakt\core.py", line 452, in _handle_request
    json_data = json.loads(response.content.decode('UTF-8', 'ignore'))
  File "C:\Program Files (x86)\Python38-32\lib\json\__init__.py", line 357, in loads
    return _default_decoder.decode(s)
  File "C:\Program Files (x86)\Python38-32\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Program Files (x86)\Python38-32\lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

@bbakermmc
Copy link
Author

Processing section Movies
Traceback (most recent call last):
  File "C:\Program Files (x86)\Python38-32\lib\site-packages\urllib3\connectionpool.py", line 665, in urlopen
    httplib_response = self._make_request(
  File "C:\Program Files (x86)\Python38-32\lib\site-packages\urllib3\connectionpool.py", line 421, in _make_request
    six.raise_from(e, None)
  File "<string>", line 3, in raise_from
  File "C:\Program Files (x86)\Python38-32\lib\site-packages\urllib3\connectionpool.py", line 416, in _make_request
    httplib_response = conn.getresponse()
  File "C:\Program Files (x86)\Python38-32\lib\http\client.py", line 1322, in getresponse
    response.begin()
  File "C:\Program Files (x86)\Python38-32\lib\http\client.py", line 303, in begin
    version, status, reason = self._read_status()
  File "C:\Program Files (x86)\Python38-32\lib\http\client.py", line 264, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "C:\Program Files (x86)\Python38-32\lib\socket.py", line 669, in readinto
    return self._sock.recv_into(b)
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files (x86)\Python38-32\lib\site-packages\requests\adapters.py", line 439, in send
    resp = conn.urlopen(
  File "C:\Program Files (x86)\Python38-32\lib\site-packages\urllib3\connectionpool.py", line 719, in urlopen
    retries = retries.increment(
  File "C:\Program Files (x86)\Python38-32\lib\site-packages\urllib3\util\retry.py", line 400, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "C:\Program Files (x86)\Python38-32\lib\site-packages\urllib3\packages\six.py", line 734, in reraise
    raise value.with_traceback(tb)
  File "C:\Program Files (x86)\Python38-32\lib\site-packages\urllib3\connectionpool.py", line 665, in urlopen
    httplib_response = self._make_request(
  File "C:\Program Files (x86)\Python38-32\lib\site-packages\urllib3\connectionpool.py", line 421, in _make_request
    six.raise_from(e, None)
  File "<string>", line 3, in raise_from
  File "C:\Program Files (x86)\Python38-32\lib\site-packages\urllib3\connectionpool.py", line 416, in _make_request
    httplib_response = conn.getresponse()
  File "C:\Program Files (x86)\Python38-32\lib\http\client.py", line 1322, in getresponse
    response.begin()
  File "C:\Program Files (x86)\Python38-32\lib\http\client.py", line 303, in begin
    version, status, reason = self._read_status()
  File "C:\Program Files (x86)\Python38-32\lib\http\client.py", line 264, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "C:\Program Files (x86)\Python38-32\lib\socket.py", line 669, in readinto
    return self._sock.recv_into(b)
urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files (x86)\Python38-32\lib\site-packages\requests\adapters.py", line 498, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))

@Taxel
Copy link
Owner

Taxel commented Nov 17, 2019

The connection errors are nothing I can prevent (and I think the program should terminate instead of silently throwing the error in the log, so that's intended behavior), but I added a try-except block around the line where the JSONDecodeError is thrown.
Before merging those changes to the master branch I will probably just run the whole function in a try-except block since the increased readability should be more important than the minuscule performance impact this has.
Concerning the config file: In that case, you might have a bit more experience in best practices for something like that, compared to a computer science student who's about to complete his master ;)

@Taxel
Copy link
Owner

Taxel commented Nov 20, 2019

So this error does not appear all the time or at the same PlexAPI call, right?
In that case and to settle the config debate: Simply define, how you would structure the config file so it fills all your needs, there do not seem to be any more people who would like this feature, so I'll add it for your needs and whoever also needs this feature needs to use the same format and if it confuses many people I'll just change the code. Sounds good?

@bbakermmc
Copy link
Author

The config is fine for me lol. Its the least of any issues :P Yeah the decode/connection errors are random.

@oxivanisher
Copy link

Is there an update for this? I would like to rewatch a series, but its always marking it watched :D

@jofotoo
Copy link

jofotoo commented Dec 19, 2020

Is there an update for this? I would like to rewatch a series, but its always marking it watched :D

Ditto!

@bakes82
Copy link

bakes82 commented Dec 19, 2020

you need to remove it out of trakt, seems like a dumb use case honestly.

@jofotoo
Copy link

jofotoo commented Dec 19, 2020

you need to remove it out of trakt, seems like a dumb use case honestly.

People re-watch things all the time. Trakt supports it, so it should be considered as an option. For certain things, trakt should be considered 'truth' and for some plex should be.

@bakes82
Copy link

bakes82 commented Dec 19, 2020

you need to remove it out of trakt, seems like a dumb use case honestly.

People re-watch things all the time. Trakt supports it, so it should be considered as an option. For certain things, trakt should be considered 'truth' and for some plex should be.

You need plex to support your issue lol Not this plugin. Two diff things, This plugin sycns status from trakt to plex and vice versa, now you want a UI to reset your watched history in trakt, then reset it in plex, You can easly do this manually w/out any help. Login in to trakt, remove all watched history for the show/season, and then reset watched in plex. Otherwise maybe you can open your request in a diff issue. I stand by my statement. You can always open your own feature request.

@zaibas
Copy link

zaibas commented Jan 25, 2021

the new features branch doesnt exist anymore correct? has the ability to choose via config what to sync trakt->plex or plex->trakt been rolled into the master branch? using a config formatted as above did not work for me

@simonc56
Copy link
Collaborator

simonc56 commented Aug 29, 2021

A branch named new-features was created with the solution. But it has not been merged.

Such branch does not exist

new-features branch was precisely here 6849724
I recreated it.
Concerned commit implementing the one-way sync is 65db50d

@glensc
Copy link
Collaborator

glensc commented Aug 29, 2021

Started with config: #462

@glensc glensc added the help wanted Extra attention is needed label Sep 7, 2021
Repository owner locked as resolved and limited conversation to collaborators Jan 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants