diff --git a/addons/RatingAddon/RatingAddon.cs b/addons/RatingAddon/RatingAddon.cs index f36647b..36e2311 100644 --- a/addons/RatingAddon/RatingAddon.cs +++ b/addons/RatingAddon/RatingAddon.cs @@ -1,5 +1,4 @@ -// this addon writes a rating to the filename of rated videos when mpv.net -// shuts down. The input.conf defaults contain key bindings for this addon. +// sometimes the add-on don't work, it's containing a lot of trace code at the moment using System; using System.ComponentModel.Composition; @@ -57,12 +56,17 @@ namespace RatingAddon //handles keys defined in input.conf void ClientMessage(string[] args) { - if (args[0] != "rate-file" || ! int.TryParse(args[1], out int rating)) - return; - string path = mp.get_property_string("path"); - if (!File.Exists(path)) return; - Dic[path] = rating; - mp.commandv("show-text", $"Rating: {rating}"); + if (args[0] != "rate-file") return; + + if (int.TryParse(args[1], out int rating)) + { + string path = mp.get_property_string("path"); + if (!File.Exists(path)) return; + Dic[path] = rating; + mp.commandv("show-text", $"Rating: {rating}"); + } + else if (args[1] == "about") + Msg.Show("Rating Extension", "This extension writes a rating to the filename of rated videos when mpv.net shuts down.\n\nThe input.conf defaults contain key bindings for this addon to set ratings."); } } } \ No newline at end of file diff --git a/img/Main.png b/img/Main.png index 3a8ddb3..a33482e 100644 Binary files a/img/Main.png and b/img/Main.png differ diff --git a/mpv.net/Resources/inputConf.txt b/mpv.net/Resources/inputConf.txt index 5ebbc12..979872a 100644 --- a/mpv.net/Resources/inputConf.txt +++ b/mpv.net/Resources/inputConf.txt @@ -131,6 +131,8 @@ KP3 script-message rate-file 3 #menu: Extensions > Rating > 3stars KP4 script-message rate-file 4 #menu: Extensions > Rating > 4stars KP5 script-message rate-file 5 #menu: Extensions > Rating > 5stars + _ ignore #menu: Extensions > Rating > - + _ script-message rate-file about #menu: Extensions > Rating > About Ctrl+t set ontop yes #menu: View > On Top > Enable Ctrl+T set ontop no #menu: View > On Top > Disable