Flexget / Flexget

The official FlexGet repository

Home Page:http://www.flexget.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Does the labels of transmission support variable assignment?

terrellgf opened this issue · comments

I tried the following configurations, all failed:

transmission:
  labels: 
    - "{{title}}"

transmission:
  labels: 
    - '{{title}}'

transmission:
  labels: 
    - "{title}"

transmission:
  labels: 
    - '{title}'

It doesn't work......
Please help me, thx!

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.

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.

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.

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.

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?

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?

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.

This issue is stale because it has been open 150 days with no activity. Remove stale label or comment or this will be closed in 30 days.

This was added in #3886