Movie list store: remove insert call and switch back to integer rating string
[cinaest] / src / movie-filter.vala
index 549c041..08663be 100644 (file)
  * along with Cinaest. If not, see <http://www.gnu.org/licenses/>.
  */
 
-public class MovieFilter {
+public class MovieFilter : Object {
        public string title;
        public int year_min;
        public int year_max;
        public int rating_min;
-       public int genres;
+       public Genres genres;
+
+       public bool matches_title (string _title) {
+               if (title == null)
+                       return true;
+
+               if ("*" in title) {
+                       return PatternSpec.match_simple (title, _title);
+               } else {
+                       return (_title.ascii_ncasecmp (title, title.length) == 0);
+               }
+       }
 }