misc...
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
- Load AviSynth DLL from environment variable AviSynthDLL
|
||||
in order to support AviSynth portable mode.
|
||||
- New option global-media-keys (next, previous, play/pause, stop)
|
||||
- libmpv shinshiro 2020-11-22
|
||||
|
||||
|
||||
5.4.8.4 Beta
|
||||
|
||||
@@ -96,7 +96,7 @@ namespace RatingExtension // the assembly name must end with 'Extension'
|
||||
{
|
||||
TimeSpan ts = DateTime.Now - DeleteTime;
|
||||
|
||||
if (FileToDelete == core.get_property_string("path") && ts.TotalSeconds < 5)
|
||||
if (FileToDelete == core.get_property_string("path") && ts.TotalSeconds < 5 && File.Exists(FileToDelete))
|
||||
{
|
||||
core.command("playlist-remove current");
|
||||
Thread.Sleep(2000);
|
||||
|
||||
@@ -381,7 +381,8 @@ namespace Tommy
|
||||
|
||||
public override TomlNode this[string key] {
|
||||
get {
|
||||
if (RawTable.TryGetValue(key, out var result)) return result;
|
||||
if (RawTable.TryGetValue(key, out var result))
|
||||
return result;
|
||||
|
||||
var lazy = new TomlLazy(this);
|
||||
RawTable[key] = lazy;
|
||||
|
||||
@@ -6,7 +6,7 @@ keep-open = yes
|
||||
keep-open-pause = no
|
||||
osd-duration = 2000
|
||||
osd-playing-msg = '${filename}'
|
||||
script-opts = osc-scalewindowed=1.5,osc-hidetimeout=2000,console-scale=1
|
||||
script-opts = osc-scalewindowed=1.5,osc-hidetimeout=2000,osc-greenandgrumpy=yes,console-scale=1
|
||||
screenshot-directory = '~~desktop/'
|
||||
|
||||
[protocol.https]
|
||||
|
||||
@@ -120,29 +120,28 @@ namespace mpvnet
|
||||
|
||||
object LockObject = new object();
|
||||
|
||||
void Search(string searchtext)
|
||||
void Search(string searchText)
|
||||
{
|
||||
lock (LockObject)
|
||||
{
|
||||
try
|
||||
{
|
||||
List<string> items = new List<string>();
|
||||
UInt32 i;
|
||||
const int bufsize = 500;
|
||||
StringBuilder buf = new StringBuilder(bufsize);
|
||||
Everything_SetSearch(searchtext);
|
||||
StringBuilder sb = new StringBuilder(500);
|
||||
Everything_SetSearch(searchText);
|
||||
Everything_SetRequestFlags(EVERYTHING_REQUEST_FILE_NAME | EVERYTHING_REQUEST_PATH);
|
||||
Everything_Query(true);
|
||||
uint count = Everything_GetNumResults();
|
||||
|
||||
for (i = 0; i < Everything_GetNumResults(); i++)
|
||||
for (uint i = 0; i < count; i++)
|
||||
{
|
||||
Everything_GetResultFullPathName(i, buf, bufsize);
|
||||
string ext = buf.ToString().Ext();
|
||||
Everything_GetResultFullPathName(i, sb, (uint)sb.Capacity);
|
||||
string ext = sb.ToString().Ext();
|
||||
|
||||
if (App.AudioTypes.Contains(ext) || App.VideoTypes.Contains(ext)
|
||||
|| App.ImageTypes.Contains(ext))
|
||||
|
||||
items.Add(buf.ToString());
|
||||
items.Add(sb.ToString());
|
||||
|
||||
if (items.Count > 100)
|
||||
break;
|
||||
|
||||
@@ -800,6 +800,29 @@ namespace mpvnet
|
||||
HandleError(err, throwException, $"error setting property: {name} = " + value);
|
||||
}
|
||||
|
||||
public string get_opt(string name, string defaultValue = "")
|
||||
{
|
||||
string value = get_property_string("script-opts");
|
||||
|
||||
if (string.IsNullOrEmpty(value))
|
||||
return defaultValue;
|
||||
|
||||
string[] values = value.Split(',');
|
||||
|
||||
foreach (string item in values)
|
||||
{
|
||||
if (item.Contains("="))
|
||||
{
|
||||
string optionName = item.Substring(0, item.IndexOf("="));
|
||||
|
||||
if (optionName == name)
|
||||
return item.Substring(item.IndexOf("=") + 1);
|
||||
}
|
||||
}
|
||||
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
public void observe_property_int(string name, Action<int> action)
|
||||
{
|
||||
lock (IntPropChangeActions)
|
||||
|
||||
Reference in New Issue
Block a user