tweaks and refactoring

This commit is contained in:
Frank Skare
2019-07-18 05:47:16 +02:00
parent 01da76bdc4
commit 85a23fbae1
5 changed files with 110 additions and 96 deletions

View File

@@ -59,7 +59,9 @@ namespace RatingAddon
{
if (args[0] != "rate-file" || ! int.TryParse(args[1], out int rating))
return;
Dic[mp.get_property_string("path")] = rating;
string path = mp.get_property_string("path");
if (!File.Exists(path)) return;
Dic[path] = rating;
mp.commandv("show-text", $"Rating: {rating}");
}
}