by drakinite » Wed Sep 20, 2023 12:30 am
The long explanation is that each Track object also has a value for internal use, "longTextLoaded", which is enabled after the track has loaded all the long text values. So if you run any one of the three async functions (getCommentAsync, getLyricsAsync, getExtendedTagsAsync) it'll actually load the values from all three at once. Then, when longTextLoaded is true and all the long texts are loaded in memory, the synchronous versions (getCommentSync, getLyricsSync, getExtendedTagsSync) will work and return the full strings. If longTextLoaded is false when you attempt to run getCommentSync/getLyricsSync/getExtendedTagsSync, then an exception will be raised and MediaMonkey will crash.
I would not recommend dealing with longTextLoaded and the get_____Sync functions, and I would instead recommend just sticking with getCommentAsync, getLyricsAsync, and getExtendedTagsAsync.
Internally, if the long texts are already loaded in memory, the async functions will just return the values from memory anyways, so there's no performance loss.
The long explanation is that each Track object also has a value for internal use, "longTextLoaded", which is enabled after the track has loaded all the long text values. So if you run any one of the three async functions (getCommentAsync, getLyricsAsync, getExtendedTagsAsync) it'll actually load the values from all three at once. Then, when longTextLoaded is true and all the long texts are loaded in memory, the synchronous versions (getCommentSync, getLyricsSync, getExtendedTagsSync) will work and return the full strings. If longTextLoaded is false when you attempt to run getCommentSync/getLyricsSync/getExtendedTagsSync, then an exception will be raised and MediaMonkey will crash.
I would [u]not[/u] recommend dealing with longTextLoaded and the get_____Sync functions, and I would instead recommend just sticking with getCommentAsync, getLyricsAsync, and getExtendedTagsAsync.
Internally, if the long texts are already loaded in memory, the async functions will just return the values from memory anyways, so there's no performance loss.