Passed
Push — develop ( 808c7a...ccd371 )
by Dean
02:21
created

Movies.on_added()   A

Complexity

Conditions 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 4.048
Metric Value
cc 2
dl 0
loc 10
ccs 1
cts 5
cp 0.2
crap 4.048
rs 9.4285
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.ratings.base import RatingsHandler
4
5 1
import logging
6
7 1
log = logging.getLogger(__name__)
8
9
10 1
class Base(PushHandler, RatingsHandler):
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
    pass
12
13
14 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...
15 1
    media = SyncMedia.Movies
16
17 1
    @bind('added', [SyncMode.Full, SyncMode.Push])
18
    def on_added(self, key, p_guid, p_item, p_value, t_value, **kwargs):
19
        log.debug('Movies.on_added(%r, ...)', key)
20
21
        if t_value:
22
            return
23
24
        self.store_movie('add', p_guid,
25
            p_item,
26
            rating=p_value
27
        )
28
29
30 1
class Shows(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...
31 1
    media = SyncMedia.Shows
32
33 1
    @bind('added', [SyncMode.Full, SyncMode.Push])
34
    def on_added(self, key, p_guid, p_item, p_value, t_value, **kwargs):
35
        log.debug('Shows.on_added(%r, ...)', key)
36
37
        if t_value:
38
            return
39
40
        self.store_show('add', p_guid,
41
            p_item,
42
            rating=p_value
43
        )
44
45
46 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...
47 1
    media = SyncMedia.Episodes
48
49 1
    @bind('added', [SyncMode.Full, SyncMode.Push])
50
    def on_added(self, key, p_guid, identifier, p_show, p_value, t_value, **kwargs):
51
        log.debug('Episodes.on_added(%r, ...)', key)
52
53
        if t_value:
54
            return
55
56
        self.store_episode('add', p_guid,
57
            identifier, p_show,
58
            rating=p_value
59
        )
60
61
62 1
class Push(DataHandler):
63 1
    data = SyncData.Ratings
64 1
    mode = SyncMode.Push
65
66 1
    children = [
67
        Movies,
68
69
        Shows,
70
        Episodes
71
    ]
72