Mark video as watched.
346951
def markWatched(self):
        
        key = '/:/scrobble?key=%s&identifier=com.plexapp.plugins.library' % self.ratingKey
        self._server.query(key)
        self.reload()
823977
def last_video(self):
        """"""
        if self._cached_videos is None:
            self.make_video_cache()

        if self._cached_videos:
            return self._cached_videos[0]
        return None
767309
def unwatch(self):
        """"""
        if self.watchers is not None:
            unwatched = []
            for watcher in self.watchers:
                watcher.inst.param.unwatch(watcher)
                unwatched.append(watcher)
            self.watchers = [w for w in self.watchers if w not in unwatched]
1142588
def do_video(self, args):
        """"""
        func = getattr(args, 'func', None)
        if func is not None:
            # Call whatever subcommand function was selected
            func(self, args)
        else:
            # No subcommand was provided, so call help
            self.do_help('video')
1035154
def add_to_watched(self, watched):
        
        assert isinstance(watched, github.Repository.Repository), watched
        headers, data = self._requester.requestJsonAndCheck(
            "PUT",
            "/repos/" + watched._identity + "/subscription",
            input={"subscribed": True}
        )
65360
def cleanup_video(self):
        '''
        
        '''
        if self.video_source_process is not None:
            self.video_source_process.terminate()
            logger.info('Terminated video process: %s',
                        self.video_source_process.pid)
            self.video_source_process = None
715548
private void initializeVideoInfo() {
    VIDEO_INFO.put("The Big Bang Theory", "http://thetvdb.com/banners/_cache/posters/80379-9.jpg");
    VIDEO_INFO.put("Breaking Bad", "http://thetvdb.com/banners/_cache/posters/81189-22.jpg");
    VIDEO_INFO.put("Arrow", "http://thetvdb.com/banners/_cache/posters/257655-15.jpg");
    VIDEO_INFO.put("Game of Thrones", "http://thetvdb.com/banners/_cache/posters/121361-26.jpg");
    VIDEO_INFO.put("Lost", "http://thetvdb.com/banners/_cache/posters/73739-2.jpg");
    VIDEO_INFO.put("How I met your mother",
        "http://thetvdb.com/banners/_cache/posters/75760-29.jpg");
    VIDEO_INFO.put("Dexter", "http://thetvdb.com/banners/_cache/posters/79349-24.jpg");
    VIDEO_INFO.put("Sleepy Hollow", "http://thetvdb.com/banners/_cache/posters/269578-5.jpg");
    VIDEO_INFO.put("The Vampire Diaries", "http://thetvdb.com/banners/_cache/posters/95491-27.jpg");
    VIDEO_INFO.put("Friends", "http://thetvdb.com/banners/_cache/posters/79168-4.jpg");
    VIDEO_INFO.put("New Girl", "http://thetvdb.com/banners/_cache/posters/248682-9.jpg");
    VIDEO_INFO.put("The Mentalist", "http://thetvdb.com/banners/_cache/posters/82459-1.jpg");
    VIDEO_INFO.put("Sons of Anarchy", "http://thetvdb.com/banners/_cache/posters/82696-1.jpg");
  }
864312
def record_entering(self, time, code, frame_key, parent_stats):
        """"""
        stats = parent_stats.ensure_child(code, RecordingStatistics)
        self._times_entered[(code, frame_key)] = time
        stats.own_hits += 1
166406
def maybe_start_recording(tokens, index):
        """"""
        if tokens[index].type == TokenType.BeginInlineRST:
            return _InlineRSTRecorder(index)
145546
def watch_async(self, limit=None, timeout=None):
        """"""
        return self.watch(limit=limit, timeout=timeout)
1316121
def _remember_videos(page, fetches, stitch_ups=None):
    '''
    
    '''
    if not 'videos' in page:
        page.videos = []
    for fetch in fetches or []:
        content_type = fetch['response_headers'].get_content_type()
        if (content_type.startswith('video/')
                # skip manifests of DASH segmented video -
                # see https://github.com/internetarchive/brozzler/pull/70
                and content_type != 'video/vnd.mpeg.dash.mpd'
                and fetch['method'] == 'GET'
                and fetch['response_code'] in (200, 206)):
            video = {
                'blame': 'youtube-dl',
                'url': fetch['url'],
                'response_code': fetch['response_code'],
                'content-type': content_type,
            }
            if 'content-length' in fetch['response_headers']:
                video['content-length'] = int(
                        fetch['response_headers']['content-length'])
            if 'content-range' in fetch['response_headers']:
                video['content-range'] = fetch[
                        'response_headers']['content-range']
            logging.debug('embedded video %s', video)
            page.videos.append(video)
    for stitch_up in stitch_ups or []:
        if stitch_up['content-type'].startswith('video/'):
            video = {
                'blame': 'youtube-dl',
                'url': stitch_up['url'],
                'response_code': stitch_up['response_code'],
                'content-type': stitch_up['content-type'],
                'content-length': stitch_up['content-length'],
            }
            logging.debug('embedded video %s', video)
            page.videos.append(video)
1135380
public void startWatching() {
        try {
            final List<MonitorLine> lines = getSource().getLastLine(getInitialCount());
            actual = null;
            updateLines(lines);
        } catch (Exception e) {
            notifyObservers(e);
        }
    }
174771
function recordWatchedFiles(processName, filePath, watchedFiles) {
  if (typeof watchedFiles[processName] !== 'undefined' &&
      watchedFiles[processName].length > 0) {
    watchedFiles[processName].push(filePath);
  } else {
    watchedFiles[processName] = [filePath];
  }
}
124719
public void markAsViewed(int notificationId) {
		getResourceFactory()
				.getApiResource("/notification/" + notificationId + "/viewed")
				.entity(new Empty(), MediaType.APPLICATION_JSON_TYPE).post();
	}
414727
function Video (data) {
    const autoPlay = data.attr.autoPlay
    const playStatus = data.attr.playStatus
    this.autoPlay = autoPlay === true || autoPlay === 'true'
    if (playStatus !== 'play'
        && playStatus !== 'stop'
        && playStatus !== 'pause') {
      this.playStatus = 'pause'
    }
    else {
      this.playStatus = playStatus
    }
    Atomic.call(this, data)
  }
138723
public void mark(long n) {
        tickIfNecessary();
        count.addAndGet(n);
        m15Rate.update(n);
        m120Rate.update(n);
    }
1321497
def backup_watched(plex, opts):
    
    data = defaultdict(lambda: dict())
    for section in _iter_sections(plex, opts):
        print('Fetching watched status for %s..' % section.title)
        skey = section.title.lower()
        for item in _iter_items(section):
            if not opts.watchedonly or item.isWatched:
                ikey = _item_key(item)
                data[skey][ikey] = item.isWatched
                import pprint; pprint.pprint(item.__dict__); break
    print('Writing backup file to %s' % opts.filepath)
    with open(opts.filepath, 'w') as handle:
        json.dump(dict(data), handle, sort_keys=True, indent=2)