Skip to content

Commit 39d057c

Browse files
author
Chris Bellew
committed
Updated readme; Reordered pattern matching so latest episode query is caught before "watch <show> episode <episode name>"
1 parent 2547e55 commit 39d057c

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Below are examples of what to say to Google Now to trigger playback. Sentence fr
2222
### For TV Shows:
2323
"**Watch Season** *1* **Episode** *1* **of** *Homeland*"
2424

25-
"**Watch** *Homeland* **Season** *1* **Episode** *1*"
25+
"**Watch** *The Newsroom* **Season** *1* **Episode** *2*"
2626

2727
"**Watch** *Breaking Bad* **Season** *5* **Episode** *8*"
2828

src/com/atomjack/vcfpht/PlayMediaActivity.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -326,22 +326,22 @@ private void handleVoiceSearch() {
326326
}
327327
}
328328
if(mediaType.equals("")) {
329-
p = Pattern.compile("watch (.*) episode (.*)");
329+
p = Pattern.compile("watch( the)? latest episode of (.*)");
330330
matcher = p.matcher(queryText);
331+
331332
if(matcher.find()) {
332333
mediaType = "show";
333-
episodeSpecified = matcher.group(2);
334-
showSpecified = matcher.group(1);
334+
latest = true;
335+
queryTerm = matcher.group(2);
335336
}
336337
}
337338
if(mediaType.equals("")) {
338-
p = Pattern.compile("watch( the)? latest episode of (.*)");
339+
p = Pattern.compile("watch (.*) episode (.*)");
339340
matcher = p.matcher(queryText);
340-
341341
if(matcher.find()) {
342342
mediaType = "show";
343-
latest = true;
344-
queryTerm = matcher.group(2);
343+
episodeSpecified = matcher.group(2);
344+
showSpecified = matcher.group(1);
345345
}
346346
}
347347
// Lastly, try to find a movie matching whatever comes after "watch"

0 commit comments

Comments
 (0)