new main screenshot, about dialog for rating addon

This commit is contained in:
Frank Skare
2019-07-21 19:56:19 +02:00
parent 2bbaa30322
commit 936274fc3b
3 changed files with 14 additions and 8 deletions

View File

@@ -1,5 +1,4 @@
// this addon writes a rating to the filename of rated videos when mpv.net // sometimes the add-on don't work, it's containing a lot of trace code at the moment
// shuts down. The input.conf defaults contain key bindings for this addon.
using System; using System;
using System.ComponentModel.Composition; using System.ComponentModel.Composition;
@@ -57,12 +56,17 @@ namespace RatingAddon
//handles keys defined in input.conf //handles keys defined in input.conf
void ClientMessage(string[] args) void ClientMessage(string[] args)
{ {
if (args[0] != "rate-file" || ! int.TryParse(args[1], out int rating)) if (args[0] != "rate-file") return;
return;
string path = mp.get_property_string("path"); if (int.TryParse(args[1], out int rating))
if (!File.Exists(path)) return; {
Dic[path] = rating; string path = mp.get_property_string("path");
mp.commandv("show-text", $"Rating: {rating}"); 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.");
} }
} }
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 MiB

After

Width:  |  Height:  |  Size: 2.5 MiB

View File

@@ -131,6 +131,8 @@
KP3 script-message rate-file 3 #menu: Extensions > Rating > 3stars KP3 script-message rate-file 3 #menu: Extensions > Rating > 3stars
KP4 script-message rate-file 4 #menu: Extensions > Rating > 4stars KP4 script-message rate-file 4 #menu: Extensions > Rating > 4stars
KP5 script-message rate-file 5 #menu: Extensions > Rating > 5stars 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 yes #menu: View > On Top > Enable
Ctrl+T set ontop no #menu: View > On Top > Disable Ctrl+T set ontop no #menu: View > On Top > Disable