Passed
Push — develop ( 29d60b...a27323 )
by Dean
02:35
created

Base.push()   A

Complexity

Conditions 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1.125
Metric Value
cc 1
dl 0
loc 3
ccs 1
cts 2
cp 0.5
crap 1.125
rs 10
1 1
from plugin.sync.core.enums import SyncData, SyncMedia, SyncMode
2 1
from plugin.sync.handlers.core import DataHandler, PushHandler, bind
3 1
from plugin.sync.handlers.playback.base import PlaybackHandler
4
5 1
import logging
6
7 1
log = logging.getLogger(__name__)
8
9
10 1
class Base(PushHandler, PlaybackHandler):
0 ignored issues
show
Bug introduced by
The method fast_pull which was declared abstract in the super-class MediaHandler
was not overridden.

Methods which raise NotImplementedError should be overridden in concrete child classes.

Loading history...
Bug introduced by
The method full which was declared abstract in the super-class MediaHandler
was not overridden.

Methods which raise NotImplementedError should be overridden in concrete child classes.

Loading history...
Bug introduced by
The method on_added which was declared abstract in the super-class MediaHandler
was not overridden.

Methods which raise NotImplementedError should be overridden in concrete child classes.

Loading history...
Bug introduced by
The method on_changed which was declared abstract in the super-class MediaHandler
was not overridden.

Methods which raise NotImplementedError should be overridden in concrete child classes.

Loading history...
Bug introduced by
The method on_removed which was declared abstract in the super-class MediaHandler
was not overridden.

Methods which raise NotImplementedError should be overridden in concrete child classes.

Loading history...
Bug introduced by
The method pull which was declared abstract in the super-class MediaHandler
was not overridden.

Methods which raise NotImplementedError should be overridden in concrete child classes.

Loading history...
11 1
    def push(self, p_item, t_item, **kwargs):
12
        # TODO Currently disabled, batch pushing of progress changes isn't supported on trakt
0 ignored issues
show
Coding Style introduced by
TODO and FIXME comments should generally be avoided.
Loading history...
13
        return True
14
15
16 1
class Movies(Base):
0 ignored issues
show
Bug introduced by
The method fast_pull which was declared abstract in the super-class MediaHandler
was not overridden.

Methods which raise NotImplementedError should be overridden in concrete child classes.

Loading history...
Bug introduced by
The method full which was declared abstract in the super-class MediaHandler
was not overridden.

Methods which raise NotImplementedError should be overridden in concrete child classes.

Loading history...
Bug introduced by
The method on_changed which was declared abstract in the super-class MediaHandler
was not overridden.

Methods which raise NotImplementedError should be overridden in concrete child classes.

Loading history...
Bug introduced by
The method on_removed which was declared abstract in the super-class MediaHandler
was not overridden.

Methods which raise NotImplementedError should be overridden in concrete child classes.

Loading history...
Bug introduced by
The method pull which was declared abstract in the super-class MediaHandler
was not overridden.

Methods which raise NotImplementedError should be overridden in concrete child classes.

Loading history...
17 1
    media = SyncMedia.Movies
18
19 1
    @bind('added', [SyncMode.Full, SyncMode.Push])
20
    def on_added(self, key, guid, p_item, p_value, t_value, **kwargs):
0 ignored issues
show
Unused Code introduced by
The argument p_item seems to be unused.
Loading history...
Unused Code introduced by
The argument guid seems to be unused.
Loading history...
21
        log.debug('Movies.on_added(%r, ...)', key)
22
23
        if t_value:
24
            return
25
26
        log.debug(' - p_value: %r, t_value: %r', p_value, t_value)
27
28
29 1
class Episodes(Base):
0 ignored issues
show
Bug introduced by
The method fast_pull which was declared abstract in the super-class MediaHandler
was not overridden.

Methods which raise NotImplementedError should be overridden in concrete child classes.

Loading history...
Bug introduced by
The method full which was declared abstract in the super-class MediaHandler
was not overridden.

Methods which raise NotImplementedError should be overridden in concrete child classes.

Loading history...
Bug introduced by
The method on_changed which was declared abstract in the super-class MediaHandler
was not overridden.

Methods which raise NotImplementedError should be overridden in concrete child classes.

Loading history...
Bug introduced by
The method on_removed which was declared abstract in the super-class MediaHandler
was not overridden.

Methods which raise NotImplementedError should be overridden in concrete child classes.

Loading history...
Bug introduced by
The method pull which was declared abstract in the super-class MediaHandler
was not overridden.

Methods which raise NotImplementedError should be overridden in concrete child classes.

Loading history...
30 1
    media = SyncMedia.Episodes
31
32 1
    @bind('added', [SyncMode.Full, SyncMode.Push])
33
    def on_added(self, key, guid, identifier, p_show, p_value, t_value, **kwargs):
0 ignored issues
show
Unused Code introduced by
The argument p_show seems to be unused.
Loading history...
Unused Code introduced by
The argument guid seems to be unused.
Loading history...
Unused Code introduced by
The argument identifier seems to be unused.
Loading history...
34
        log.debug('Episodes.on_added(%r, ...)', key)
35
36
        if t_value:
37
            return
38
39
        log.debug(' - p_value: %r, t_value: %r', p_value, t_value)
40
41
42 1
class Push(DataHandler):
43 1
    data = SyncData.Playback
44 1
    mode = SyncMode.Push
45
46 1
    children = [
47
        Movies,
48
        Episodes
49
    ]
50