The Movie Database 支持

Hi

Can you please correct the error that occurs when details are downloaded for a movie or TV show. What happens is that the 'ratings' field seems to be often contain more than 1 digit after the decimal point. For apps like Synology Video Station this causes an error because it is only able to accept a rating with 1 digit after the decimal point. 1 dp should be enough I think.

Thanks

11 回复(第 1 页,共 1 页)

Jump to last post

@wangbombat@@~~ said:
Rating Error
Hi
Can you please correct the error that occurs when details are downloaded for a movie or TV show.
What happens is that the 'ratings' field seems to be often contain more than 1 digit after the decimal point.
For apps like Synology Video Station this causes an error because it is only able to accept a rating with 1 digit after the decimal point. 1 dp should be enough I think.
Thanks

I believe it's been a long time since the value of "vote_average" has 3 digits after the decimal point.
Did you also make this request to Synology support ?
https://kb.synology.com/en-my/DSM/help/DSM/SupportCenter/SupportCenter_desc?version=6
If yes, what was the answer?

It still shows ratings more than 1 d.p. I cannot add a screenshot but Star Wars VII shows a rating of 7.313. Others I've seen have ratings with up to 10 digits or so. The auto process in Video Station just fails when it encounters video info like this and so each file needs to be downloaded individually (and this isn't feasible to do.) Synology simply don't reply...

I have the exact same problem. I have to manually go in and round up/down the ratings in order for the synopsis and poster artwork to be added. Is there not a way that Synology can do the rounding themselves, so that it can be updated automatically?

Synology probably could fix this easily but they just never bother to reply. Consequently I brought it up here hoping the team could make the required change directly.

This might help some. This inability to truncate the decimals was super annoying.

  1. ssh to your syno
  2. go to the MovieDB plugin dir /var/packages/VideoStation/target/plugins/syno_themoviedb
  3. sudo vi ./search.py (make a backup before)
  4. These are two edits you need to do you will be replacing only two rows that begin with "data=" within two functions below def _parse_movie_info & def _parse_episode_info
def _parse_movie_info(movie_data):
    # ... (rest of the code remains the same)

    if movie_data['vote_average']:
        data = _set_data_value(data, ['extra', constant.PLUGINID, 'rating', 'themoviedb'], round(movie_data['vote_average'], 1))

    # ... (rest of the code remains the same)
    return data

# ... (other functions remain the same)

def _parse_episode_info(tv_data, episode_data, season, episode):
    # ... (rest of the code remains the same)

    data = _set_data_value(data, ['extra', constant.PLUGINID, 'rating', 'themoviedb_tv'], round(tv_data['vote_average'], 1))

    # ... (rest of the code remains the same)
    return data

# ... (rest of the script remains the same)

You may also change this one to be "False" as well at the very top of the script. This prevent the video station from randomly guessing movie titles

parser.add_argument("--allowguess", type=bool, default=False)

I followed the instructions from https://www.themoviedb.org/talk/634c0d22a61de1007effbb93 but after the sudo vi ./search.py command, I'm not sure what is supposed to happen? I was expecting some text file where I could edit the lines. This is my output and I'm stuck at this.

Putty output

you will need to enter your password to run as a root -- the file in question is owned by the VideoStation user and if you open it as an Admin, you won't be able to write the changes down. Do not forget to backup before editing.

I've since modified handling of the "allowguess" section -- here it is -- both updated and the original so you will see what I commented out.


#Updated LIMIT/ALLOWGUESS Section
    LIMIT = 100
    ALLOWGUESS = False
    parser.add_argument("-l", "--limit", type=int, default=LIMIT, help='result count')
    parser.add_argument("-g", "--allowguess", action='store_true', default=ALLOWGUESS, help='allow guessing')
    parser.add_argument("--apikey", type=str, default='')

#    BELOW THREE LINES ARE ORIGINAL. They were replaced by the five lines above
#    parser.add_argument("--limit", type=int, default=100, help='result count')
#    parser.add_argument("--allowguess", type=bool, default=True)
#    parser.add_argument("--apikey", type=str, default='')

Hello, I would very dearly like to apply this fix to my TMDB plugin but have no idea how to use ssh. Following the instructions above using Windows CMD client, I have been able to open the 'search.py' file but can't edit it. To save me hours in a futile search to educate myself could someone patiently explain the following:

  1. How do I backup the original 'search.py' file?
  2. How do I edit it?
  3. How do I save the edited file?

Many thanks, Mac.

Hey, Mac

On Win, there are plenty of SSH clients, I personally use Putty. You will have to use "sudo" to edit the search.py file with the vi editor. Back it up with "cp". Make sure the permissions of the edited file are still assigned to the VideoStation user:group (check with "ls -la", change with "chown").

ChatGPT or Bing are great resources to understand the basic command without going through dozens of man pages.

Another thing is the "vi" itself it could be super confusing if you've never used it. Not sure if "nano" can be deployed on Synology, probably.

Thanks for your help. I wasn't able to backup the original file as I received a permission denied but I was able to edit it. It all appears to be working well.

This allowed me to open the search.py file in vi:

sudo vi /var/packages/VideoStation/target/plugins/syno_themoviedb/search.py

找不到电影或节目?登录并创建它吧。

全站通用

s 聚焦到搜索栏
p 打开个人资料菜单
esc 关闭打开的窗口
? 打开键盘快捷键窗口

在媒体页面

b 返回(或返回上级)
e 进入编辑页面

在电视季页面

(右箭头)下一季
(左箭头)前一季

在电视集页面

(右箭头)下一集
(左箭头)上一集

在所有图像页面

a 打开添加图片窗口

在所有编辑页面

t 打开翻译选择器
ctrl+ s 提交

在讨论页面

n 创建新讨论
w 切换关注状态
p 设为公开 / 私密讨论
c 关闭 / 开放讨论
a 打开活动页
r 回复讨论
l 跳转至最新回复
ctrl+ enter 发送信息
(右箭头)下一页
(左箭头)前一页

设置

想给这个条目评分或将其添加到片单中?

登录

还不是会员?

注册加入社区