Universalmediaserver: Double coding ?

Created on 3 Aug 2016  路  15Comments  路  Source: UniversalMediaServer/UniversalMediaServer

Is that normal ? (in _RealFile.java_)

if (cachedThumbnail == null) {
    cachedThumbnail = FileUtil.getFileNameWithAddedExtension(thumbFolder, file, ".cover.jpg");
            }

if (cachedThumbnail == null) {
    cachedThumbnail = FileUtil.getFileNameWithAddedExtension(thumbFolder, file, ".cover.png");
            }

All 15 comments

@Sami32 You should link directly to the lines in the code, it's very hard to interpret code out of context. Here is an example: https://github.com/UniversalMediaServer/UniversalMediaServer/blob/f1a86766d4ebf7042e63a5da01d206bf7d84a1b6/src/main/java/net/pms/dlna/RealFile.java#L247

The code isn't a duplicate, the first time around it looks for a jpg, the second time for a png. The code checks if the thumbnail is null before doing it, which means that if no thumbnail is set by that stage and a matching file of type jpg is found, that is used. Then, if no thumbnail is still set after that, a matching file of type png is looked for. This means that jpg gets precedence, which I'm not sure is the right decision given that jpg doesn't support transparancy, but it might have been done this way because more renderer supports jpg than png. It only matters in the case where thumbnails exists in both formats anyway, which I guess is rare.

@Nadahar It's why it was closed as fast as open, perhaps 10s.
This just want to say I need to go to the optician, No need to make a pendulum ;-)

You mean "precedence", right ?
I share the choice JPG as precedence for the purpose of greater support. Thanks for comments.

@Sami32 Yes, I meant precedence. I'm not native either..

@Nadahar I know that, you are Norvegian ?, i was just friendly teasing you ;-)

Yes, I am :wink:

@Nadahar Whatever, we are all europeans, except the english :-D
As you can see, norvegian english teachers are much better than french ones ;-)
I'm just jalous about your english skill.

@Sami32 Don't give the teachers any credit, they were useless. I've learned English in several ways: I've worked some abroad, my sister lived in London for some years and ofcourse there's the little I learned at school.

But, I think there are two major contributions for me: First, TV and movies aren't dubbed in the Nordic countries, we use subtitles instead. Only kid programs are dubbed, but when I was a kid they were also mostly subtitled. Given the amount of ...stuff... Hollywood puts out, you're bound to spend quite a few hours reading Norwegian text while hearing the English speach. I think it's quite an effective way to learn, and dubbing is just stupid. I even want subtitles on Norwegian programs and movies, simply because that means I don't have to have the sound so loud to hear the voices amongst all the other noise they put in there, Second, I've I started using the internet actively in 1995 (I actually spent a lot of time on IRC back then) and I've read tons of technical litterature which is almost always English. On the university all the books were in English too. I often find it easier to read technical litterature in English than in Norwegian, I'm not used to the Norwegian terms. In short, I read probably 3-4 times as much English text a day that I do Norwegian, so some of it is bound to stick. I write English much better then I speak, my muscle memory isn't used to the sounds.

@Nadahar As you maybe know, french and japanese are the worst in language learning, certainely because everything is translated, subtitled.
Like we say, we speak english like a spanish cow ;-) I you laught, want just listen to our policians :-D
Like you i didn't really learn at school, except the grammar, but when travelling, India is perfect for a frenchie ;-) , and reading university literature in Quebec.
But now i only practice reading informations on Internet.

BTW, the Markdown language is really special on Github, i just learned how to make linebreak...not very friendful to me.

@Sami32 In my experience the Chinese/Taiwanese are the absolute worst in English. I've seen letters from Chinese and Taiwanese businessmen that were completely impossible to interpret. I don't think they are exposed to much non-Chinese.

It seems to me like they often use translation services like Google translate, and understand so little of the result that they think what comes out makes sense. People should always try to reverse translate what they have translated that way, and they will see how hopeless it is.

I agree that the Markdown takes som getting used to, but I'm not sure what you mean about line break. I simply press enter...

@Nadahar Yes, but they for excuse than forreign contact was forbiden, but since few years it's changing rapidely.

I use frequently google translate, and i verified that for tha茂 or lao they are definitively not good.
But i didn't even thought about reverse translation test, thanks for the idea :-)

Concerning the formatting you're wrong, like i did, if you do ENTER with your linebreak you get a blank line for free as well...not for INSTALL.txt but for the wiki part.

@Sami32 We must be talking about something different.
I can do line break like this
using enter only.

@Nadahar Not in the wiki !

@Sami32 No, it seems like the Wiki use more of a HTML approach. Inserting a simple HTML <br> seems to work fine though. HTML is a formatting nightmare imo.

@Nadahar "I take you the hand in the bag" like we say in France, meaning that now i know that you never participate to the Wiki ;-)

@Sami32 I never pretended to :wink: But I think I've actually added some small stuff there once.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Rebel154 picture Rebel154  路  6Comments

SsJVasto picture SsJVasto  路  4Comments

SubJunk picture SubJunk  路  5Comments

SubJunk picture SubJunk  路  8Comments

SubJunk picture SubJunk  路  3Comments