Giter VIP home page Giter VIP logo

Comments (7)

crawln45 avatar crawln45 commented on June 20, 2024

It's been a while since I looked at it. But I'm almost 100% sure we didn't implement jinja rendering for labels. Id have to look at it again. That being said I don't believe that's implemented at the moment.

from flexget.

terrellgf avatar terrellgf commented on June 20, 2024

It's been a while since I looked at it. But I'm almost 100% sure we didn't implement jinja rendering for labels. Id have to look at it again. That being said I don't believe that's implemented at the moment.

Thanks for your reply.
I need to use this function to get my file storage location, and use a system-level script to verify movie ratings to imdb website every day. Delete a movie if it doesn't meet the expected rating within 7 days of downloading it. To avoid the problem that happened earlier when a movie rated 7.3 had 108 votes, but two days later it had 540 votes and only got a 5.8 rating. I don't want to fix this by raising the limit vote count because I don't want to miss out on every potential new movie.
Initially I also tried to implement this functionality with flexget's plugin. I guess the imdb plugin does not have the function to force bypass the cache content, which makes it impossible for me to get the real-time score of imdb.

from flexget.

crawln45 avatar crawln45 commented on June 20, 2024

Caching I believe is set to 4 hrs. I could be wrong but that sounds about right. So as long as your checking the next day, your pulling fresh information. Implementing this would be similar in fashion to any of the other jinja rendering where we check and call the render function. You can look at many other plugins to check how it's implemented.

from flexget.

terrellgf avatar terrellgf commented on June 20, 2024

Caching I believe is set to 4 hrs. I could be wrong but that sounds about right. So as long as your checking the next day, your pulling fresh information. Implementing this would be similar in fashion to any of the other jinja rendering where we check and call the render function. You can look at many other plugins to check how it's implemented.

The movie was downloaded on the 29th, but the rating is still 7.3 on the 30th (5.8 on the imdb website), and it has been more than 24 hours. I implemented this function with the filesystem/age/imdb_lookup/imdb/delete plugin.

from flexget.

terrellgf avatar terrellgf commented on June 20, 2024
def expired(self):
    """
    :return: True if movie details are considered to be expired, ie. need of update
    """
    if self.updated is None:
        logger.debug('updated is None: {}', self)
        return True
    refresh_interval = 2
    if self.year:
        # Make sure age is not negative
        age = max((datetime.now().year - self.year), 0)
        refresh_interval += age * 5
        logger.debug('movie `{}` age {} expires in {} days', self.title, age, refresh_interval)
    return self.updated < datetime.now() - timedelta(days=refresh_interval)

def __repr__(self):
    return f'<Movie(name={self.title},votes={self.votes},year={self.year})>'

The movie whose rating dropped from 7.3 to 5.8 was released in 2023. From the above code, we can see that the cache expiration time is 2 + (2023 - 2023) * 5, which means it takes two days to update the cache.
Is there anything else?

from flexget.

gazpachoking avatar gazpachoking commented on June 20, 2024

The movie whose rating dropped from 7.3 to 5.8 was released in 2023. From the above code, we can see that the cache expiration time is 2 + (2023 - 2023) * 5, which means it takes two days to update the cache.
Is there anything else?

That looks right. The ratings updates are the exact reason the cache is shorter for newer movies. Is this not working for you, or you want the cache to be shorter?

I'm not exactly sure how your initial request for templating support in the labels would help? What were you going to store in the labels?

from flexget.

terrellgf avatar terrellgf commented on June 20, 2024

The movie whose rating dropped from 7.3 to 5.8 was released in 2023. From the above code, we can see that the cache expiration time is 2 + (2023 - 2023) * 5, which means it takes two days to update the cache.
Is there anything else?

That looks right. The ratings updates are the exact reason the cache is shorter for newer movies. Is this not working for you, or you want the cache to be shorter?

I'm not exactly sure how your initial request for templating support in the labels would help? What were you going to store in the labels?

I've solved my current problem using this update function logic, so this problem becomes less urgent for me. But I still hope to support assigning variable values ​​to transmission labels in the future.

from flexget.

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.