Coder Social home page Coder Social logo

Comments (8)

Rawns avatar Rawns commented on June 19, 2024 2

Pending closure, changes to be included in 1.0.10.

from reddit-wallpaper-changer.

benedikt257 avatar benedikt257 commented on June 19, 2024 1

Added pull request #27 to fix RWC entering a state where it is running but no timers to search for a wallpaper are enabled, as described in my last comment.

from reddit-wallpaper-changer.

Rawns avatar Rawns commented on June 19, 2024 1

Committed the changes. :)

I've also moved the "is an image URL?" and "is still on Imgur?" checks into the background worker process when actually looking for a wallpaper, rather than at the 'setting wallpaper stage. I've been running a new build in a VM with my changes, your commit and @BlackDragon17 's settings and set it to change my wallpaper every minute. So far, it's been running for about an hour now and is changing my wallpaper quite happily. It's also pulled a few links form DeviantArt too without any problems. :)

17/02/2017 10:56:55 - WIN10-VM: Found a wallpaper! Title: River Fields Study by Piotr Dura, URL: http://threedeee.deviantart.com/art/River-Fields-Study-534022462, ThreadID: 36j8gw
17/02/2017 10:56:55 - WIN10-VM: Setting wallpaper.
17/02/2017 10:56:56 - WIN10-VM: URL: http://img12.deviantart.net/bc3b/i/2015/139/0/d/river_fields_study_by_threedeee-d8txyda.jpg
17/02/2017 10:56:56 - WIN10-VM: Title: River Fields Study by Piotr Dura
17/02/2017 10:56:56 - WIN10-VM: Thread ID: 36j8gw
17/02/2017 10:56:56 - WIN10-VM: Wallpaper changed!
17/02/2017 10:57:55 - WIN10-VM: Changing wallpaper.

from reddit-wallpaper-changer.

BlackDragon17 avatar BlackDragon17 commented on June 19, 2024

I think two possible solutions to this behavior could be:

  1. Making RWC capable of interpreting DeviantArt links, as in, when it receives an indirect DA image link (example), it should convert it to a direct image link (example).

  2. Increasing the number of times that RWC tries to change the wallpaper before giving up from 2 to, for example, 5.

from reddit-wallpaper-changer.

benedikt257 avatar benedikt257 commented on June 19, 2024

Making RWC capable of interpreting DeviantArt links, as in, when it receives an indirect DA image link (example), it should convert it to a direct image link (example).

A logic for that is in place using oembed. The URL for your image is turned into: http://backend.deviantart.com/oembed?url=http://seansoong.deviantart.com/art/Ming-Men-Lake-358359052 and the direct url is fetched from that result.

Increasing the number of times that RWC tries to change the wallpaper before giving up from 2 to, for example, 5.

It sits at 50, however I think not every unsuccessful search will start a new one, especially when there is a bug, which seems to be the case here ;-).

@Rawns: To me, it seems as if the HttpWebRequest to check for an image you inserted at the very beginning of setWallpaper causes the issue observed here. For deviantart URLs I get a timeout every time (no clue why) which throws the exception that leads to the logmessages observed by @BlackDragon17. Adding if (!url.Contains("deviantart")) around that bit of code allows RWC to set the wallpaper in question here.
Maybe the check for deleted images and direct image links should be integrated into the workflow of the backgroundworker as it seems quite specific to the site that the program is pulling from?

from reddit-wallpaper-changer.

Rawns avatar Rawns commented on June 19, 2024

Thanks for the info. I'll get this fixed in the next release. :)

from reddit-wallpaper-changer.

benedikt257 avatar benedikt257 commented on June 19, 2024

Theoretically, RWC should start looking for another Wallpaper in a situation as described by @BlackDragon17, right?
As far as I can tell, the intended behavior is Timer breakBetweenChange is started, ticks after a second and essentially restarts the wallpaper search (by restarting the changeWallpaperTimer again).

After playing around with it for a while, I am a little confused though.

Are you sure that restarting a Timer from BackgroundWorker works? As far as I can tell, the Timer never ticks.

Replacing
breakBetweenChange.Enabled = true;
with
this.Invoke((MethodInvoker)(() => {breakBetweenChange.Enabled = true;}));
works. (Source: http://stackoverflow.com/questions/9940293/enable-system-form-timer-from-backgroundworker)

I doubt that this is best practice though and maybe it will cause other bugs. I have seen Timers.Timer mentioned as an alternative to Windows.Forms.Timer for multithreaded applications, but I haven't had the time to look into what makes that better and how to get it to work in RWC.

from reddit-wallpaper-changer.

Rawns avatar Rawns commented on June 19, 2024

Fixed.

from reddit-wallpaper-changer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.