INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Feature Request: Scheduler run as soon as possible for missed task  (Read 669 times)

Awesome Donkey

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 7804
  • Autumn shade...

I've been using the Auto Dark Mode app for Windows 11 to switch to Windows' dark theme at sunset (which then switches to Windows' light theme at sunrise). While MC does have a scheduler which allows me to change to a dark skin at sunset (and likewise a light skin at sunrise) MC's scheduler doesn't have a feature to immediately run a task if it was missed, instead opting to wait until the next scheduled time to run the task. I don't keep my PC on all the time, so those tasks can be missed. Then I have to manually switch the skin myself, which breaks the illusion of the seamless theme switching.

Windows' Task Scheduler has an option to handle this; Run task as soon as possible after a scheduled start is missed and I would like to request MC's scheduler to have a similar option. I suppose this could cause issues with other scheduled tasks, so if so limit it to the Set Skin task option then.

My intended use case is this, to have MC automatically switch to a dark skin at sunset and to a light skin at sunrise. And if I don't have my PC on at the moment of sunset or sunrise, as soon as I do start it and MC knows the schedule has been missed, it can trigger the task immediately as long as it's within the timeframe (sunset to sunrise or sunrise to sunset). I'm trying to make the switch between light mode during the day and dark mode during the night as seamless as possible. This could also function well for macOS as well.

I kinda wish there was some MCWS command or something to change the skin so I wouldn't have to rely on MC's scheduler because it's not in-sync with Auto Dark Mode when it comes to sunset and sunrise times. Auto Dark Mode itself could switch MC's skin using its custom scripts feature, which the documentation for can be found here: https://github.com/AutoDarkMode/Windows-Auto-Night-Mode/wiki/How-to-add-custom-scripts

Thoughts?
Logged
I don't work for JRiver... I help keep the forums safe from "male enhancements" and other sources of sketchy pharmaceuticals.

Windows 11 24H2 Update 64-bit + Ubuntu 24.10 Oracular Oriole 64-bit | Windows 11 24H2 Update 64-bit (Intel N305 Fanless NUC 16GB RAM/500GB M.2 NVMe SSD)
JRiver Media Center 33 (Windows + Linux) | iFi ZEN DAC 3 | JBL 306P MkII Studio Monitors | Audio-Technica ATH-M50x Headphones

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42373
  • Shoes gone again!
Re: Feature Request: Scheduler run as soon as possible for missed task
« Reply #1 on: October 11, 2023, 10:03:04 am »

I kinda wish there was some MCWS command or something to change the skin

Take a look at Settings/Skin.  It should allow you to change the skin based on a skin name.  If you need more flexibility there, just let us know how.  Thanks.
Logged
Matt Ashland, JRiver Media Center

Awesome Donkey

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 7804
  • Autumn shade...
Re: Feature Request: Scheduler run as soon as possible for missed task
« Reply #2 on: October 11, 2023, 10:34:20 am »

Hmmm, I'm not seeing any way to execute URL commands via Auto Dark Mode's custom scripts (plus I don't prefer having Media Network enabled, as it slows down closing MC and I don't need it when I have the Pi doing Media Network stuff), is there a command line or even a core command available to do this via the MC31.exe stub?

Something like this maybe for the command line...

Code: [Select]
MC31.exe /Skin "Modern Cards: Mica Grey Edition"
EDIT: I see you can execute MCWS from the command line too, but it doesn't work with Auto Dark Mode's scripts no matter what I've tried. In fact, I can't even get it to work correctly via a batch script. Pretty sure it's the question mark in the command that's causing it to not work with either Auto Dark Mode's scripts or via batch script. Unfortunately I'm not a developer and I don't have too much time to mess with it. Back to the drawing board, I guess.

EDIT 2: Okay, finally got it working using batch scripts, YAY! That wasn't fun...

EDIT 3: Whew, got it fully working now, DOUBLE YAY! When Auto Dark Mode changes Windows' theme to the dark theme at sunset, MC will change skins alongside it. Likewise when it changes Windows' theme to the light theme at sunrise, MC will change skins too! :D

Thanks Matt for the hint! :D
Logged
I don't work for JRiver... I help keep the forums safe from "male enhancements" and other sources of sketchy pharmaceuticals.

Windows 11 24H2 Update 64-bit + Ubuntu 24.10 Oracular Oriole 64-bit | Windows 11 24H2 Update 64-bit (Intel N305 Fanless NUC 16GB RAM/500GB M.2 NVMe SSD)
JRiver Media Center 33 (Windows + Linux) | iFi ZEN DAC 3 | JBL 306P MkII Studio Monitors | Audio-Technica ATH-M50x Headphones

mattlovell

  • Galactic Citizen
  • ****
  • Posts: 330
Re: Feature Request: Scheduler run as soon as possible for missed task
« Reply #3 on: October 11, 2023, 08:11:11 pm »

Quote
EDIT 2: Okay, finally got it working using batch scripts, YAY! That wasn't fun...

Care to share those now-working batch scripts?  ;D
Logged

Awesome Donkey

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 7804
  • Autumn shade...
Re: Feature Request: Scheduler run as soon as possible for missed task
« Reply #4 on: October 12, 2023, 03:47:46 pm »

Care to share those now-working batch scripts?  ;D

Sure thing. The script will detect whether Media Center 31.exe is running or not (to prevent the batch script from starting MC if it's closed) and if it is it changes the skin.

Code: [Select]
@echo off

tasklist /fi "ImageName eq Media Center 31.exe" /fo csv 2>NUL | find /I "Media Center 31.exe">NUL

if "%ERRORLEVEL%"=="0"  (MC31 /MCWS/v1/Settings/Skin?Skin="Modern Cards: Mica Grey Edition") else (exit)

exit

I use the same command in two batch files, one for the light skin and one for the dark skin. Auto Dark Mode will trigger the light batch file at sunrise, and the dark batch file at sunset.
Logged
I don't work for JRiver... I help keep the forums safe from "male enhancements" and other sources of sketchy pharmaceuticals.

Windows 11 24H2 Update 64-bit + Ubuntu 24.10 Oracular Oriole 64-bit | Windows 11 24H2 Update 64-bit (Intel N305 Fanless NUC 16GB RAM/500GB M.2 NVMe SSD)
JRiver Media Center 33 (Windows + Linux) | iFi ZEN DAC 3 | JBL 306P MkII Studio Monitors | Audio-Technica ATH-M50x Headphones
Pages: [1]   Go Up