]> git.basschouten.com Git - openhab-addons.git/blob
a248a92efeff401f05c02f07c90f3d3d460a2566
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2024 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
7  * This program and the accompanying materials are made available under the
8  * terms of the Eclipse Public License 2.0 which is available at
9  * http://www.eclipse.org/legal/epl-2.0
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.kaleidescape.internal.handler;
14
15 import static org.openhab.binding.kaleidescape.internal.KaleidescapeBindingConstants.*;
16
17 import java.util.Arrays;
18 import java.util.Collection;
19 import java.util.HashMap;
20 import java.util.HashSet;
21 import java.util.List;
22 import java.util.Map;
23 import java.util.Set;
24 import java.util.concurrent.ScheduledFuture;
25 import java.util.concurrent.TimeUnit;
26
27 import javax.measure.Unit;
28 import javax.measure.quantity.Time;
29
30 import org.eclipse.jdt.annotation.NonNullByDefault;
31 import org.eclipse.jdt.annotation.Nullable;
32 import org.eclipse.jetty.client.HttpClient;
33 import org.openhab.binding.kaleidescape.internal.KaleidescapeException;
34 import org.openhab.binding.kaleidescape.internal.KaleidescapeThingActions;
35 import org.openhab.binding.kaleidescape.internal.communication.KaleidescapeConnector;
36 import org.openhab.binding.kaleidescape.internal.communication.KaleidescapeDefaultConnector;
37 import org.openhab.binding.kaleidescape.internal.communication.KaleidescapeIpConnector;
38 import org.openhab.binding.kaleidescape.internal.communication.KaleidescapeMessageEvent;
39 import org.openhab.binding.kaleidescape.internal.communication.KaleidescapeMessageEventListener;
40 import org.openhab.binding.kaleidescape.internal.communication.KaleidescapeSerialConnector;
41 import org.openhab.binding.kaleidescape.internal.configuration.KaleidescapeThingConfiguration;
42 import org.openhab.core.io.transport.serial.SerialPortManager;
43 import org.openhab.core.library.types.NextPreviousType;
44 import org.openhab.core.library.types.OnOffType;
45 import org.openhab.core.library.types.PercentType;
46 import org.openhab.core.library.types.PlayPauseType;
47 import org.openhab.core.library.types.RewindFastforwardType;
48 import org.openhab.core.library.types.StringType;
49 import org.openhab.core.library.unit.Units;
50 import org.openhab.core.thing.ChannelUID;
51 import org.openhab.core.thing.Thing;
52 import org.openhab.core.thing.ThingStatus;
53 import org.openhab.core.thing.ThingStatusDetail;
54 import org.openhab.core.thing.ThingTypeUID;
55 import org.openhab.core.thing.binding.BaseThingHandler;
56 import org.openhab.core.thing.binding.ThingHandlerService;
57 import org.openhab.core.types.Command;
58 import org.openhab.core.types.RefreshType;
59 import org.openhab.core.types.State;
60 import org.slf4j.Logger;
61 import org.slf4j.LoggerFactory;
62
63 /**
64  * The {@link KaleidescapeHandler} is responsible for handling commands, which are sent to one of the channels.
65  *
66  * Based on the Rotel binding by Laurent Garnier
67  *
68  * @author Michael Lobstein - Initial contribution
69  */
70 @NonNullByDefault
71 public class KaleidescapeHandler extends BaseThingHandler implements KaleidescapeMessageEventListener {
72     private static final long RECON_POLLING_INTERVAL_S = 60;
73     private static final long POLLING_INTERVAL_S = 20;
74
75     private final Logger logger = LoggerFactory.getLogger(KaleidescapeHandler.class);
76     private final SerialPortManager serialPortManager;
77     private final Map<String, String> cache = new HashMap<>();
78
79     protected final HttpClient httpClient;
80     protected final Unit<Time> apiSecondUnit = Units.SECOND;
81
82     private ThingTypeUID thingTypeUID = THING_TYPE_PLAYER;
83     private @Nullable ScheduledFuture<?> reconnectJob;
84     private @Nullable ScheduledFuture<?> pollingJob;
85     private long lastEventReceived = 0;
86     private int updatePeriod = 0;
87
88     protected KaleidescapeConnector connector = new KaleidescapeDefaultConnector();
89     protected int metaRuntimeMultiple = 1;
90     protected int volume = 0;
91     protected boolean volumeEnabled = false;
92     protected boolean isMuted = false;
93     protected boolean isLoadHighlightedDetails = false;
94     protected boolean isLoadAlbumDetails = false;
95     protected String friendlyName = EMPTY;
96     protected Object sequenceLock = new Object();
97
98     public KaleidescapeHandler(Thing thing, SerialPortManager serialPortManager, HttpClient httpClient) {
99         super(thing);
100         this.serialPortManager = serialPortManager;
101         this.httpClient = httpClient;
102     }
103
104     protected void updateChannel(String channelUID, State state) {
105         this.updateState(channelUID, state);
106     }
107
108     protected void updateDetailChannel(String channelUID, State state) {
109         this.updateState(DETAIL + channelUID, state);
110     }
111
112     protected void updateThingProperty(String name, String value) {
113         thing.setProperty(name, value);
114     }
115
116     protected boolean isChannelLinked(String channel) {
117         return isLinked(channel);
118     }
119
120     @Override
121     public void initialize() {
122         final String uid = this.getThing().getUID().getAsString();
123         KaleidescapeThingConfiguration config = getConfigAs(KaleidescapeThingConfiguration.class);
124
125         this.thingTypeUID = thing.getThingTypeUID();
126
127         // Check configuration settings
128         String configError = null;
129         final String serialPort = config.serialPort;
130         final String host = config.host;
131         final Integer port = config.port;
132         final Integer updatePeriod = config.updatePeriod;
133         this.isLoadHighlightedDetails = config.loadHighlightedDetails;
134         this.isLoadAlbumDetails = config.loadAlbumDetails;
135
136         if ((serialPort == null || serialPort.isEmpty()) && (host == null || host.isEmpty())) {
137             configError = "undefined serialPort and host configuration settings; please set one of them";
138         } else if (host == null || host.isEmpty()) {
139             if (serialPort != null && serialPort.toLowerCase().startsWith("rfc2217")) {
140                 configError = "use host and port configuration settings for a serial over IP connection";
141             }
142         } else {
143             if (port == null) {
144                 configError = "undefined port configuration setting";
145             } else if (port <= 0) {
146                 configError = "invalid port configuration setting";
147             }
148         }
149
150         if (configError != null) {
151             updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, configError);
152             return;
153         }
154
155         if (updatePeriod != null) {
156             this.updatePeriod = updatePeriod;
157         }
158
159         // check if volume is enabled
160         if (config.volumeEnabled) {
161             this.volumeEnabled = true;
162             this.volume = config.initialVolume;
163             this.updateState(VOLUME, new PercentType(this.volume));
164             this.updateState(MUTE, OnOffType.OFF);
165         }
166
167         if (serialPort != null) {
168             connector = new KaleidescapeSerialConnector(serialPortManager, serialPort, uid);
169         } else if (port != null) {
170             connector = new KaleidescapeIpConnector(host, port, uid);
171         } else {
172             updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR,
173                     "Either Serial port or Host & Port must be specifed");
174             return;
175         }
176
177         updateStatus(ThingStatus.UNKNOWN);
178
179         scheduleReconnectJob();
180         schedulePollingJob();
181     }
182
183     @Override
184     public void dispose() {
185         cancelReconnectJob();
186         cancelPollingJob();
187         closeConnection();
188     }
189
190     @Override
191     public Collection<Class<? extends ThingHandlerService>> getServices() {
192         return List.of(KaleidescapeThingActions.class);
193     }
194
195     public void handleRawCommand(@Nullable String command) {
196         synchronized (sequenceLock) {
197             try {
198                 connector.sendCommand(command);
199             } catch (KaleidescapeException e) {
200                 logger.warn("K Command: {} failed", command);
201             }
202         }
203     }
204
205     @Override
206     public void handleCommand(ChannelUID channelUID, Command command) {
207         String channel = channelUID.getId();
208
209         if (getThing().getStatus() != ThingStatus.ONLINE) {
210             logger.debug("Thing is not ONLINE; command {} from channel {} is ignored", command, channel);
211             return;
212         }
213         synchronized (sequenceLock) {
214             if (!connector.isConnected()) {
215                 logger.debug("Command {} from channel {} is ignored: connection not established", command, channel);
216                 return;
217             }
218
219             try {
220                 if (command instanceof RefreshType) {
221                     handleRefresh(channel);
222                     return;
223                 }
224
225                 switch (channel) {
226                     case POWER:
227                         if (command instanceof OnOffType) {
228                             connector.sendCommand(command == OnOffType.ON ? LEAVE_STANDBY : ENTER_STANDBY);
229                         }
230                         break;
231                     case VOLUME:
232                         if (command instanceof PercentType percentCommand) {
233                             this.volume = (int) percentCommand.doubleValue();
234                             logger.debug("Got volume command {}", this.volume);
235                             connector.sendCommand(SEND_EVENT_VOLUME_LEVEL_EQ + this.volume);
236                         }
237                         break;
238                     case MUTE:
239                         if (command instanceof OnOffType) {
240                             this.isMuted = command == OnOffType.ON ? true : false;
241                         }
242                         connector.sendCommand(SEND_EVENT_MUTE + (this.isMuted ? MUTE_ON : MUTE_OFF));
243                         break;
244                     case MUSIC_REPEAT:
245                         if (command instanceof OnOffType) {
246                             connector.sendCommand(command == OnOffType.ON ? MUSIC_REPEAT_ON : MUSIC_REPEAT_OFF);
247                         }
248                         break;
249                     case MUSIC_RANDOM:
250                         if (command instanceof OnOffType) {
251                             connector.sendCommand(command == OnOffType.ON ? MUSIC_RANDOM_ON : MUSIC_RANDOM_OFF);
252                         }
253                         break;
254                     case CONTROL:
255                     case MUSIC_CONTROL:
256                         handleControlCommand(command);
257                         break;
258                     case CHANNEL_TYPE_SENDCMD:
259                         connector.sendCommand(command.toString());
260                         break;
261                     default:
262                         logger.debug("Command {} from channel {} failed: unexpected command", command, channel);
263                         break;
264                 }
265             } catch (KaleidescapeException e) {
266                 logger.debug("Command {} from channel {} failed: {}", command, channel, e.getMessage());
267                 updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, "Sending command failed");
268                 closeConnection();
269                 scheduleReconnectJob();
270             }
271         }
272     }
273
274     /**
275      * Open the connection with the Kaleidescape component
276      *
277      * @return true if the connection is opened successfully or false if not
278      */
279     private synchronized boolean openConnection() {
280         connector.addEventListener(this);
281         try {
282             connector.open();
283         } catch (KaleidescapeException e) {
284             logger.debug("openConnection() failed: {}", e.getMessage());
285         }
286         logger.debug("openConnection(): {}", connector.isConnected() ? "connected" : "disconnected");
287         return connector.isConnected();
288     }
289
290     /**
291      * Close the connection with the Kaleidescape component
292      */
293     private synchronized void closeConnection() {
294         if (connector.isConnected()) {
295             connector.close();
296             connector.removeEventListener(this);
297             logger.debug("closeConnection(): disconnected");
298         }
299     }
300
301     @Override
302     public void onNewMessageEvent(KaleidescapeMessageEvent evt) {
303         lastEventReceived = System.currentTimeMillis();
304
305         // check if we are in standby
306         if (STANDBY_MSG.equals(evt.getKey())) {
307             if (!ThingStatusDetail.BRIDGE_OFFLINE.equals(thing.getStatusInfo().getStatusDetail())) {
308                 updateStatus(ThingStatus.ONLINE, ThingStatusDetail.BRIDGE_OFFLINE, STANDBY_MSG);
309             }
310             return;
311         }
312         try {
313             // Use the Enum valueOf to handle the message based on the event key. Otherwise there would be a huge
314             // case statement here
315             KaleidescapeMessageHandler.valueOf(evt.getKey()).handleMessage(evt.getValue(), this);
316
317             if (!evt.isCached()) {
318                 cache.put(evt.getKey(), evt.getValue());
319             }
320
321             if (ThingStatusDetail.BRIDGE_OFFLINE.equals(thing.getStatusInfo().getStatusDetail())) {
322                 // no longer in standby, update the status
323                 updateStatus(ThingStatus.ONLINE, ThingStatusDetail.NONE, this.friendlyName);
324             }
325         } catch (IllegalArgumentException e) {
326             logger.debug("Unhandled message: key {} = {}", evt.getKey(), evt.getValue());
327         }
328     }
329
330     /**
331      * Schedule the reconnection job
332      */
333     private void scheduleReconnectJob() {
334         logger.debug("Schedule reconnect job");
335         cancelReconnectJob();
336         reconnectJob = scheduler.scheduleWithFixedDelay(() -> {
337             synchronized (sequenceLock) {
338                 if (!connector.isConnected()) {
339                     logger.debug("Trying to reconnect...");
340                     closeConnection();
341                     String error = EMPTY;
342                     if (openConnection()) {
343                         try {
344                             cache.clear();
345
346                             // register the connection in the Kaleidescape System log
347                             connector.sendCommand(SEND_TO_SYSLOG + "openHAB Kaleidescape Binding version "
348                                     + org.openhab.core.OpenHAB.getVersion());
349
350                             Set<String> initialCommands = new HashSet<>(Arrays.asList(GET_DEVICE_TYPE_NAME,
351                                     GET_FRIENDLY_NAME, GET_DEVICE_INFO, GET_SYSTEM_VERSION, GET_DEVICE_POWER_STATE,
352                                     GET_CINEMASCAPE_MASK, GET_CINEMASCAPE_MODE, GET_SCALE_MODE, GET_SCREEN_MASK,
353                                     GET_SCREEN_MASK2, GET_VIDEO_MODE, GET_UI_STATE, GET_HIGHLIGHTED_SELECTION,
354                                     GET_CHILD_MODE_STATE, GET_PLAY_STATUS, GET_MOVIE_LOCATION, GET_MOVIE_MEDIA_TYPE,
355                                     GET_PLAYING_TITLE_NAME));
356
357                             // Premiere Players and Cinema One support music
358                             if (thingTypeUID.equals(THING_TYPE_PLAYER) || thingTypeUID.equals(THING_TYPE_CINEMA_ONE)) {
359                                 initialCommands.addAll(Arrays.asList(GET_MUSIC_NOW_PLAYING_STATUS,
360                                         GET_MUSIC_PLAY_STATUS, GET_MUSIC_TITLE));
361                             }
362
363                             // everything after Premiere Player supports GET_SYSTEM_READINESS_STATE
364                             if (!thingTypeUID.equals(THING_TYPE_PLAYER)) {
365                                 initialCommands.add(GET_SYSTEM_READINESS_STATE);
366                             }
367
368                             // only Strato supports the GET_*_COLOR commands
369                             if (thingTypeUID.equals(THING_TYPE_STRATO)) {
370                                 initialCommands.addAll(Arrays.asList(GET_VIDEO_COLOR, GET_CONTENT_COLOR));
371                             }
372
373                             initialCommands.forEach(command -> {
374                                 try {
375                                     connector.sendCommand(command);
376                                 } catch (KaleidescapeException e) {
377                                     logger.debug("{}: {}", "Error sending initial commands", e.getMessage());
378                                 }
379                             });
380
381                             if (this.updatePeriod == 1) {
382                                 connector.sendCommand(SET_STATUS_CUE_PERIOD_1);
383                             }
384                         } catch (KaleidescapeException e) {
385                             error = "First command after connection failed";
386                             logger.debug("{}: {}", error, e.getMessage());
387                             closeConnection();
388                         }
389                     } else {
390                         error = "Reconnection failed";
391                     }
392                     if (!error.equals(EMPTY)) {
393                         updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, error);
394                         return;
395                     }
396                     updateStatus(ThingStatus.ONLINE, ThingStatusDetail.NONE, this.friendlyName);
397                     lastEventReceived = System.currentTimeMillis();
398                 }
399             }
400         }, 1, RECON_POLLING_INTERVAL_S, TimeUnit.SECONDS);
401     }
402
403     /**
404      * Cancel the reconnection job
405      */
406     private void cancelReconnectJob() {
407         ScheduledFuture<?> reconnectJob = this.reconnectJob;
408         if (reconnectJob != null) {
409             reconnectJob.cancel(true);
410             this.reconnectJob = null;
411         }
412     }
413
414     /**
415      * Schedule the polling job
416      */
417     private void schedulePollingJob() {
418         logger.debug("Schedule polling job");
419         cancelPollingJob();
420
421         pollingJob = scheduler.scheduleWithFixedDelay(() -> {
422             synchronized (sequenceLock) {
423                 if (connector.isConnected()) {
424                     logger.debug("Polling the component for updated status...");
425                     try {
426                         connector.ping();
427                         cache.clear();
428                     } catch (KaleidescapeException e) {
429                         logger.debug("Polling error: {}", e.getMessage());
430                     }
431
432                     // if the last successful polling update was more than 1.25 intervals ago,
433                     // the component is not responding even though the connection is still good
434                     if ((System.currentTimeMillis() - lastEventReceived) > (POLLING_INTERVAL_S * 1.25 * 1000)) {
435                         logger.debug("Component not responding to status requests");
436                         updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR,
437                                 "Component not responding to status requests");
438                         closeConnection();
439                         scheduleReconnectJob();
440                     }
441                 }
442             }
443         }, POLLING_INTERVAL_S, POLLING_INTERVAL_S, TimeUnit.SECONDS);
444     }
445
446     /**
447      * Cancel the polling job
448      */
449     private void cancelPollingJob() {
450         ScheduledFuture<?> pollingJob = this.pollingJob;
451         if (pollingJob != null) {
452             pollingJob.cancel(true);
453             this.pollingJob = null;
454         }
455     }
456
457     private void handleControlCommand(Command command) throws KaleidescapeException {
458         if (command instanceof PlayPauseType) {
459             if (command == PlayPauseType.PLAY) {
460                 connector.sendCommand(PLAY);
461             } else if (command == PlayPauseType.PAUSE) {
462                 connector.sendCommand(PAUSE);
463             }
464         } else if (command instanceof NextPreviousType) {
465             if (command == NextPreviousType.NEXT) {
466                 connector.sendCommand(NEXT);
467             } else if (command == NextPreviousType.PREVIOUS) {
468                 connector.sendCommand(PREVIOUS);
469             }
470         } else if (command instanceof RewindFastforwardType) {
471             if (command == RewindFastforwardType.FASTFORWARD) {
472                 connector.sendCommand(SCAN_FORWARD);
473             } else if (command == RewindFastforwardType.REWIND) {
474                 connector.sendCommand(SCAN_REVERSE);
475             }
476         } else {
477             logger.warn("Unknown control command: {}", command);
478         }
479     }
480
481     private void handleRefresh(String channel) throws KaleidescapeException {
482         switch (channel) {
483             case POWER:
484                 connector.sendCommand(GET_DEVICE_POWER_STATE, cache.get("DEVICE_POWER_STATE"));
485                 break;
486             case VOLUME:
487                 updateState(channel, new PercentType(this.volume));
488                 break;
489             case MUTE:
490                 updateState(channel, OnOffType.from(this.isMuted));
491                 break;
492             case TITLE_NAME:
493                 connector.sendCommand(GET_PLAYING_TITLE_NAME, cache.get("TITLE_NAME"));
494                 break;
495             case PLAY_MODE:
496             case PLAY_SPEED:
497             case TITLE_NUM:
498             case TITLE_LENGTH:
499             case TITLE_LOC:
500             case CHAPTER_NUM:
501             case CHAPTER_LENGTH:
502             case CHAPTER_LOC:
503                 connector.sendCommand(GET_PLAY_STATUS, cache.get("PLAY_STATUS"));
504                 break;
505             case MOVIE_MEDIA_TYPE:
506                 connector.sendCommand(GET_MOVIE_MEDIA_TYPE, cache.get("MOVIE_MEDIA_TYPE"));
507                 break;
508             case MOVIE_LOCATION:
509                 connector.sendCommand(GET_MOVIE_LOCATION, cache.get("MOVIE_LOCATION"));
510                 break;
511             case VIDEO_MODE:
512             case VIDEO_MODE_COMPOSITE:
513             case VIDEO_MODE_COMPONENT:
514             case VIDEO_MODE_HDMI:
515                 connector.sendCommand(GET_VIDEO_MODE, cache.get("VIDEO_MODE"));
516                 break;
517             case VIDEO_COLOR:
518             case VIDEO_COLOR_EOTF:
519                 connector.sendCommand(GET_VIDEO_COLOR, cache.get("VIDEO_COLOR"));
520                 break;
521             case CONTENT_COLOR:
522             case CONTENT_COLOR_EOTF:
523                 connector.sendCommand(GET_CONTENT_COLOR, cache.get("CONTENT_COLOR"));
524                 break;
525             case SCALE_MODE:
526                 connector.sendCommand(GET_SCALE_MODE, cache.get("SCALE_MODE"));
527                 break;
528             case ASPECT_RATIO:
529             case SCREEN_MASK:
530                 connector.sendCommand(GET_SCREEN_MASK, cache.get("SCREEN_MASK"));
531                 break;
532             case SCREEN_MASK2:
533                 connector.sendCommand(GET_SCREEN_MASK2, cache.get("SCREEN_MASK2"));
534                 break;
535             case CINEMASCAPE_MASK:
536                 connector.sendCommand(GET_CINEMASCAPE_MASK, cache.get("GET_CINEMASCAPE_MASK"));
537                 break;
538             case CINEMASCAPE_MODE:
539                 connector.sendCommand(GET_CINEMASCAPE_MODE, cache.get("CINEMASCAPE_MODE"));
540                 break;
541             case UI_STATE:
542                 connector.sendCommand(GET_UI_STATE, cache.get("UI_STATE"));
543                 break;
544             case CHILD_MODE_STATE:
545                 connector.sendCommand(GET_CHILD_MODE_STATE, cache.get("CHILD_MODE_STATE"));
546                 break;
547             case SYSTEM_READINESS_STATE:
548                 connector.sendCommand(GET_SYSTEM_READINESS_STATE, cache.get("SYSTEM_READINESS_STATE"));
549                 break;
550             case HIGHLIGHTED_SELECTION:
551                 connector.sendCommand(GET_HIGHLIGHTED_SELECTION, cache.get("HIGHLIGHTED_SELECTION"));
552                 break;
553             case USER_DEFINED_EVENT:
554             case USER_INPUT:
555             case USER_INPUT_PROMPT:
556                 updateState(channel, StringType.EMPTY);
557                 break;
558             case MUSIC_REPEAT:
559             case MUSIC_RANDOM:
560                 connector.sendCommand(GET_MUSIC_NOW_PLAYING_STATUS, cache.get("MUSIC_NOW_PLAYING_STATUS"));
561                 break;
562             case MUSIC_TRACK:
563             case MUSIC_ARTIST:
564             case MUSIC_ALBUM:
565             case MUSIC_TRACK_HANDLE:
566             case MUSIC_ALBUM_HANDLE:
567             case MUSIC_NOWPLAY_HANDLE:
568                 connector.sendCommand(GET_MUSIC_TITLE, cache.get("MUSIC_TITLE"));
569                 break;
570             case MUSIC_PLAY_MODE:
571             case MUSIC_PLAY_SPEED:
572             case MUSIC_TRACK_LENGTH:
573             case MUSIC_TRACK_POSITION:
574             case MUSIC_TRACK_PROGRESS:
575                 connector.sendCommand(GET_MUSIC_PLAY_STATUS, cache.get("MUSIC_PLAY_STATUS"));
576                 break;
577             case DETAIL_TYPE:
578             case DETAIL_TITLE:
579             case DETAIL_ALBUM_TITLE:
580             case DETAIL_COVER_ART:
581             case DETAIL_COVER_URL:
582             case DETAIL_HIRES_COVER_URL:
583             case DETAIL_RATING:
584             case DETAIL_YEAR:
585             case DETAIL_RUNNING_TIME:
586             case DETAIL_ACTORS:
587             case DETAIL_ARTIST:
588             case DETAIL_DIRECTORS:
589             case DETAIL_GENRES:
590             case DETAIL_RATING_REASON:
591             case DETAIL_SYNOPSIS:
592             case DETAIL_REVIEW:
593             case DETAIL_COLOR_DESCRIPTION:
594             case DETAIL_COUNTRY:
595             case DETAIL_ASPECT_RATIO:
596             case DETAIL_DISC_LOCATION:
597                 updateState(channel, StringType.EMPTY);
598                 break;
599         }
600     }
601 }