{"id":445737,"date":"2025-01-22T09:08:46","date_gmt":"2025-01-22T09:08:46","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=445737"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=445737","title":{"rendered":"<span>\u041e\u0434\u0430 \u043e\u0434\u043d\u043e\u0439 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0435 \u0438 \u0435\u0449\u0451 \u043f\u0430\u0440\u043e\u0447\u043a\u0435, \u0438\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 Jellyfin<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>Jellyfin \u2014 \u044d\u0442\u043e \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0439 \u043c\u0435\u0434\u0438\u0430\u0441\u0435\u0440\u0432\u0435\u0440 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043e\u0439 Emby \u0438 Plex. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0443, \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u044b\u043b\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0439 \u0432 \u043a\u043e\u0434\u0435 Jellyfin. \u0418 \u0435\u0449\u0451 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0448\u0438\u0431\u043e\u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/9ef\/18c\/07d\/9ef18c07d208a99ca436938b708e6e44.png\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/\/post_images\/9ef\/18c\/07d\/9ef18c07d208a99ca436938b708e6e44.png\"\/><\/figure>\n<h3>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0435<\/h3>\n<p><a href=\"https:\/\/jellyfin.org\/\">Jellyfin<\/a> \u0441\u043e\u0437\u0434\u0430\u043d \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0440\u0435\u043b\u0438\u0437\u0430 Emby 3.5.2 \u0438 \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0451\u043d \u043d\u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443 .NET Core \u0434\u043b\u044f \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u043d\u043e\u0439 \u043a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u043e\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438.<\/p>\n<p>\u0418\u0434\u0435\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0434\u0438\u0430\u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043c\u043e\u0433\u0430\u0442\u044c \u0432 \u0441\u0431\u043e\u0440\u0435 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0432\u0441\u0435\u043c\u0438 \u043c\u0435\u0434\u0438\u0430-\u0444\u0430\u0439\u043b\u0430\u043c\u0438 \u0438\u0437 \u043e\u0434\u043d\u043e\u0433\u043e \u0438 \u0442\u043e\u0433\u043e \u0436\u0435 \u043c\u0435\u0441\u0442\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u043a\u043e\u0433\u0434\u0430 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0435 \u0441\u0435\u0440\u0432\u0435\u0440, \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0441\u0435 \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u0434\u043e\u043b\u0436\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 \u0444\u0438\u043b\u044c\u043c\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432\u044b\u0431\u043e\u0440\u0430 \u0444\u0438\u043b\u044c\u043c\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0445\u043e\u0442\u0438\u0442\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u043d\u0430 \u043f\u0430\u043d\u0435\u043b\u0438 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 (\u0440\u0435\u0439\u0442\u0438\u043d\u0433, \u0436\u0430\u043d\u0440\u044b, \u0438\u043c\u044f, \u0441\u0442\u0443\u0434\u0438\u0438 \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435). \u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0444\u0430\u0439\u043b\u044b \u0441\u0443\u0431\u0442\u0438\u0442\u0440\u043e\u0432 \u0438\u0437 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432.<\/p>\n<p>\u041f\u0440\u043e\u0435\u043a\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 Emby, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441 \u0434\u0435\u043a\u0430\u0431\u0440\u044f 2018 \u0433\u043e\u0434\u0430 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043c\u0443\u043b\u044c\u0442\u0438\u043c\u0435\u0434\u0438\u0439\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c. \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c Jellyfin \u0438 \u043d\u0430\u0441\u043b\u0430\u0434\u0438\u0442\u044c\u0441\u044f \u0432\u0441\u0435\u043c\u0438 \u0435\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442 \u043d\u0430\u0447\u0430\u0442\u044c \u0441\u043e \u0441\u0432\u0435\u0436\u0435\u0439 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0441\u043a\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438.<\/p>\n<p>\u041c\u0435\u0434\u0438\u0430\u0441\u0435\u0440\u0432\u0435\u0440 Jellyfin \u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u0440\u0435\u0434\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u043d\u043e \u0440\u0430\u043d\u0435\u0435 \u043d\u0435 \u0431\u044b\u043b \u0437\u0430\u043c\u0435\u0447\u0435\u043d PVS-Studio. \u0425\u043e\u0442\u044f \u0435\u0433\u043e \u043f\u0440\u0430\u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c \u2014 \u043f\u0440\u043e\u0435\u043a\u0442 Emby \u2014 \u0431\u044b\u043b <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/csharp\/0705\/\">\u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d \u043d\u0430\u0448\u0438\u043c \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u043c<\/a>. \u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 PVS-Studio \u0434\u043e\u0431\u0440\u0430\u043b\u0441\u044f \u0438 \u0434\u043e Jellyfin. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0435\u0440\u0435\u0439\u0434\u0451\u043c \u043a \u043e\u0448\u0438\u0431\u043a\u0430\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u0414\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 Jellyfin, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0434\u043b\u044f \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u043d\u0430 <a href=\"https:\/\/github.com\/jellyfin\/jellyfin\/tree\/v10.9.11\">GitHub<\/a>.<\/p>\n<h3>\u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0430 V3022<\/h3>\n<p>V3022 \u2014 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b\u0430 \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u043e\u0448\u0438\u0431\u043e\u043a \u0432 \u044d\u0442\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435. \u0427\u0442\u043e\u0431\u044b \u043b\u0443\u0447\u0448\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u043a\u0430\u043a \u043e\u043d\u0430 \u0442\u0430\u043a \u0445\u043e\u0440\u043e\u0448\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0430 \u0441\u0435\u0431\u044f \u0432 \u044d\u0442\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u043e\u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/p>\n<p>\u0412 \u043e\u0441\u043d\u043e\u0432\u0435 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0438 V3022 \u043b\u0435\u0436\u0438\u0442 \u0430\u043d\u0430\u043b\u0438\u0437 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 (data flow \u0430\u043d\u0430\u043b\u0438\u0437). \u0410\u043d\u0430\u043b\u0438\u0437 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u2014 \u044d\u0442\u043e \u043c\u0435\u0442\u043e\u0434\u0438\u043a\u0430, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0430\u044f \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c\u0443 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0443 \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0438 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0447\u0430\u0441\u0442\u044f\u0445 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430. \u041f\u043e\u0434 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u043c\u044b\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u043f\u043e\u043d\u0438\u043c\u0430\u044e\u0442\u0441\u044f \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u044b \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0438\u043b\u0438 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439. \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0442\u043e\u043c, \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0430 \u043f\u0430\u043c\u044f\u0442\u044c \u043f\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044e \u0438\u043b\u0438 \u043d\u0435\u0442, \u043a\u0430\u043a\u043e\u0432\u044b \u0440\u0430\u0437\u043c\u0435\u0440\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435.<\/p>\n<p>\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u0445 \u0441\u0442\u0440\u043e\u044f\u0442\u0441\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043f\u043e \u0433\u0440\u0430\u0444\u0443 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b (control flow graph). \u0412 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0437\u043d\u0430\u0442\u044c \u0442\u043e\u0447\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0438\u043b\u0438 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f. \u041d\u043e \u043e\u043d \u043c\u043e\u0436\u0435\u0442, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u0440\u044f\u043c\u044b\u0435 \u0438 \u043a\u043e\u0441\u0432\u0435\u043d\u043d\u044b\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f, \u043d\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u043c\u044b\u0435 \u043d\u0430 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u044b\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043f\u043e \u0445\u043e\u0434\u0443 \u043e\u0431\u0445\u043e\u0434\u0430 \u0433\u0440\u0430\u0444\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043e \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430\u0445 \u0438\u043b\u0438 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044d\u0442\u0438 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0442\u043e\u0447\u043a\u0430\u0445 \u0433\u0440\u0430\u0444\u0430.<\/p>\n<p>\u0412\u0441\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u044b PVS-Studio \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 data flow \u0430\u043d\u0430\u043b\u0438\u0437 \u0434\u043b\u044f \u0443\u0442\u043e\u0447\u043d\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u0432\u043e\u0438\u0445 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0440\u0430\u0432\u0438\u043b. \u042d\u0442\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432 \u0441\u043b\u0443\u0447\u0430\u044f\u0445, \u043a\u043e\u0433\u0434\u0430 \u0434\u043b\u044f \u043f\u0440\u0438\u043d\u044f\u0442\u0438\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0439 \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437 AST \u0438\u043b\u0438 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u044d\u0442\u043e\u0433\u043e \u043a\u043e\u0434\u0430.<\/p>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f\u0445 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 PVS-Studio \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0437\u043d\u0430\u0442\u044c <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/0908\/\">\u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435<\/a>.<\/p>\n<h3>\u041e\u0448\u0438\u0431\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/h3>\n<h4>\u041e\u0448\u0438\u0431\u043a\u0438 \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u0438<\/h4>\n<p>\u041a\u0430\u043a \u0431\u044b\u043b\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0432\u044b\u0448\u0435, \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0439 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043d\u0430 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0443 V3022. \u0418\u043c \u0438 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u0430 \u0441\u0442\u0430\u0442\u044c\u044f. \u041d\u043e \u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0435\u0449\u0451 \u043f\u0430\u0440\u043e\u0447\u043a\u0443 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0439, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0435\u0441\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u0432\u0438\u0434\u044b \u043e\u0448\u0438\u0431\u043e\u043a.<\/p>\n<p>\u0412\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u043e\u0448\u0438\u0431\u043e\u043a \u0432 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0438 V3022 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e: \u0432\u0437\u0430\u0438\u043c\u043e\u0438\u0441\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0438\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438, \u043e\u0448\u0438\u0431\u043a\u0430 \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u0438, \u0432\u0441\u0435\u0433\u0434\u0430 \u0438\u0441\u0442\u0438\u043d\u043d\u043e\u0435\/\u043b\u043e\u0436\u043d\u043e\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435. \u041d\u043e \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u0432\u0441\u0451 \u044d\u0442\u043e \u043a \u043e\u0448\u0438\u0431\u043a\u0430\u043c \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445.<\/p>\n<p><strong>Issue 1<\/strong><\/p>\n<pre><code class=\"cs\">private void ApplyTranscodingConditions(....) {   ....    if (condition.Condition ==                       ProfileConditionType.GreaterThanEqual)  \/\/ &lt;=   {     continue;   }    switch (condition.Property)   {     case ProfileConditionValue.AudioBitrate:     {       ....       else if (condition.Condition ==                               ProfileConditionType.GreaterThanEqual)  \/\/ &lt;=       {         ....                               }        break;     }      case ProfileConditionValue.AudioSampleRate:     {       ....       else if (condition.Condition ==                               ProfileConditionType.GreaterThanEqual)  \/\/ &lt;=       {         ....                               }        break;       ....     }   } } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3022\/\">V3022<\/a> Expression &#8216;condition.Condition == ProfileConditionType.GreaterThanEqual&#8217; is always false. StreamBuilder.cs 2193<\/p>\n<p>\u042d\u0442\u043e \u0441\u0430\u043c\u0430\u044f \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u0410\u0432\u0442\u043e\u0440 \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u043b \u0435\u0451 \u0432 10 \u0431\u043b\u043e\u043a\u0430\u0445 case! \u0412 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u0437 \u043d\u0438\u0445 \u2014 \u043e\u0448\u0438\u0431\u043a\u0430 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u0430\u044f \u0432\u043e \u0432\u0441\u0435\u0445 \u0431\u043b\u043e\u043a\u0430\u0445.<\/p>\n<p>\u0412\u0441\u0451 \u0438\u0437-\u0437\u0430 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b. \u0415\u0441\u043b\u0438 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 <code>condition.Condition == ProfileConditionType.GreaterThanEqual<\/code> \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>true<\/code>, \u0442\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u0432\u043d\u0443\u0442\u0440\u044c \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0438 \u043f\u0435\u0440\u0435\u0439\u0434\u0451\u0442 \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438 \u0446\u0438\u043a\u043b\u0430, \u0442\u0430\u043a \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <code>continue<\/code>. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043d\u0438\u0436\u0435, \u0432 \u0431\u043b\u043e\u043a\u0430\u0445 <code>case<\/code>, \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 <code>true<\/code>. \u041a\u043e\u0434 \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0438\u0445 \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0441\u044f. \u0410\u0432\u0442\u043e\u0440 \u0437\u0430\u0431\u044b\u043b \u043e \u043f\u0435\u0440\u0432\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 \u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u043b \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0443 \u0432 10 \u0431\u043b\u043e\u043a\u043e\u0432 <code>case<\/code>. \u041f\u043e\u0434\u043e\u0431\u043d\u043e\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u0442 \u043a \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0438 \u043f\u043e\u0442\u0435\u0440\u0435 \u0435\u0451 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430.<\/p>\n<p><strong>Issue 2<\/strong><\/p>\n<pre><code class=\"cs\">private static bool AllowBoxSetCollapsing(InternalItemsQuery request) {   ....   if (request.IsResumable.HasValue)   {     return false;   }    if (request.IsFolder.HasValue)   {     return false;   }    if (request.Genres.Count &gt; 0)   {     return false;   }    if (request.GenreIds.Count &gt; 0)  \/\/ &lt;=   {     return false;   }    ....    if (request.GenreIds.Count &gt; 0)  \/\/ &lt;=   {     return false;   }    .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3022\/\">V3022<\/a> Expression &#8216;request.GenreIds.Count &gt; 0&#8217; is always false. Folder.cs 1243<\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442 \u043e \u043b\u0438\u0448\u043d\u0438\u043c \u0443\u0441\u043b\u043e\u0432\u0438\u0438. \u0410\u0432\u0442\u043e\u0440 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <code>request.GenreIds.Count<\/code>, \u0430 \u043f\u043e\u0442\u043e\u043c \u043d\u0438\u0436\u0435 \u0441\u0434\u0435\u043b\u0430\u043b \u044d\u0442\u043e \u0435\u0449\u0451 \u0440\u0430\u0437. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u043e\u043d \u0445\u043e\u0442\u0435\u043b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0434\u0440\u0443\u0433\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0438 \u043d\u0435 \u0437\u0430\u043c\u0435\u0442\u0438\u043b \u043e\u0448\u0438\u0431\u043a\u0438.<\/p>\n<p><strong>Issue 3<\/strong><\/p>\n<pre><code class=\"cs\">private IReadOnlyList&lt;BaseItem&gt; GetItemsForLatestItems(....) {   ....   if (parents.Count == 0)  \/\/ &lt;=   {     parents = _libraryManager.GetUserRootFolder().GetChildren(user, true)       .Where(i =&gt; i is Folder)       .Where(i =&gt; !user.GetPreferenceValues&lt;Guid&gt;                         PreferenceKind.LatestItemExcludes)       .Contains(i.Id))       .ToList();   }    if (parents.Count == 0)  \/\/ &lt;=   {     return Array.Empty&lt;BaseItem&gt;();   }   ....   if (parents.Count == 0)  \/\/ &lt;=   {     return _libraryManager.GetItemList(query, false);   } } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V3022 Expression &#8216;parents.Count == 0&#8217; is always false. UserViewManager.cs 372<\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u0430\u0432\u0442\u043e\u0440 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 <code>parents.Count<\/code>. \u0415\u0441\u043b\u0438 \u043e\u043d\u043e \u0440\u0430\u0432\u043d\u043e 0, \u0442\u043e \u043e\u043d \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442 <code>parents<\/code> \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438. \u041f\u043e\u043a\u0430 \u0432\u0441\u0451 \u043b\u043e\u0433\u0438\u0447\u043d\u043e. \u0417\u0430\u0442\u0435\u043c \u043e\u043d \u0432\u0442\u043e\u0440\u043e\u0439 \u0440\u0430\u0437 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <code>parents.Count<\/code>, \u0432\u0434\u0440\u0443\u0433 \u043d\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u043b\u0430\u0441\u044c. \u0421\u043d\u043e\u0432\u0430 \u043b\u043e\u0433\u0438\u0447\u043d\u043e. \u041f\u043e\u0442\u043e\u043c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0442\u0440\u0435\u0442\u044c\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430, \u0447\u0442\u043e\u0431\u044b \u0442\u043e\u0447\u043d\u043e \u043d\u0435 \u043e\u0448\u0438\u0431\u0438\u0442\u044c\u0441\u044f. \u041d\u043e, \u0432\u0438\u0434\u0438\u043c\u043e, \u0430\u0432\u0442\u043e\u0440 \u043d\u0435 \u0443\u0447\u0451\u043b, \u0447\u0442\u043e \u043f\u043e\u0441\u043b\u0435 \u0432\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438, \u043f\u0440\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0438 <code>parents.Count<\/code> \u0440\u0430\u0432\u043d\u043e\u043c 0, \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0432\u0435\u0440\u043d\u0451\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>Array.Empty&lt;BaseItem&gt;()<\/code> \u0438 \u0432\u044b\u0439\u0434\u0435\u0442 \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0434\u043e\u0439\u0434\u0451\u0442 \u0434\u043e \u0442\u0440\u0435\u0442\u044c\u0435\u0433\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u044f, \u043e\u043d\u043e \u0437\u0434\u0435\u0441\u044c \u043b\u0438\u0448\u043d\u0435\u0435.<\/p>\n<p><strong>Issue 4<\/strong><\/p>\n<pre><code class=\"cs\">public override string CreatePresentationUniqueKey() {   if (IndexNumber.HasValue)   {     var series = Series;     if (series is not null)     {       return series.PresentationUniqueKey + \"-\" +                 (IndexNumber ?? 0).ToString(\"000\", CultureInfo.InvariantCulture);     }   }    return base.CreatePresentationUniqueKey(); } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V3022 Expression &#8216;IndexNumber&#8217; is always not null. The operator &#8216;??&#8217; is excessive. Season.cs 135<\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0435 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <code>IndexNumber<\/code>, \u0430 \u0437\u0430\u0442\u0435\u043c \u0441\u043d\u043e\u0432\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430 <code>null<\/code>. \u041d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u0430, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0435\u0441\u043b\u0438 \u043f\u043e\u043f\u0430\u043b\u0430 \u0432 \u044d\u0442\u043e\u0442 <code>if<\/code>.<\/p>\n<p>\u041f\u043e\u0445\u043e\u0436\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430, \u0441\u043d\u043e\u0432\u0430 \u0441 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u043c <em>??<\/em>.<\/p>\n<p><strong>Issue 5<\/strong><\/p>\n<pre><code class=\"cs\">private int? GetOutputVideoCodecLevel(StreamState state) {   string levelString = string.Empty;   if (EncodingHelper.IsCopyCodec(state.OutputVideoCodec)        &amp;&amp; state.VideoStream is not null        &amp;&amp; state.VideoStream.Level.HasValue)   {     levelString = state.VideoStream.Level.Value.                         ToString(CultureInfo.InvariantCulture) ?? string.Empty;   } } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V3022 Expression &#8216;state.VideoStream.Level.Value.ToString(CultureInfo.InvariantCulture)&#8217; is always not null. The operator &#8216;??&#8217; is excessive. DynamicHlsHelper.cs 619<\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442 \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0435 \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <code>??<\/code>. \u0410\u0432\u0442\u043e\u0440 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u043b, \u0447\u0442\u043e \u043e\u043d \u0438\u0437\u0431\u0430\u0432\u0438\u0442 \u043e\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <code>null<\/code>, \u0442\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u043e\u0442 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0441 <code>null<\/code>. \u041d\u043e \u043d\u0438 \u043c\u0435\u0442\u043e\u0434 <code>ToString()<\/code>, \u043d\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>string.Empty<\/code> \u043d\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 <code>null<\/code>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043b\u0438\u0448\u043d\u044f\u044f.<\/p>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043c\u0435\u0442\u043e\u0434 <code>ToString()<\/code>, \u0447\u0442\u043e\u0431\u044b \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043e\u043d \u043d\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <code>null<\/code>:<\/p>\n<pre><code class=\"cs\">public virtual string ToString() {   return GetType().ToString(); } <\/code><\/pre>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0438\u0436\u0435:<\/p>\n<pre><code class=\"cs\">public override string ToString() {   return \"Type: \" + Name; } <\/code><\/pre>\n<p>\u041f\u043e \u044d\u0442\u043e\u043c\u0443 \u043a\u043e\u0434\u0443 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u2014 \u0441\u0442\u0440\u043e\u043a\u0430. \u042d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u043d\u0435 \u0432\u0435\u0440\u043d\u0451\u0442 <code>null<\/code>.<\/p>\n<p><strong>Issue 6<\/strong><\/p>\n<pre><code class=\"cs\">public AggregateFolder CreateRootFolder() {   ....   var path = Path.Combine(_configurationManager.ApplicationPaths.DataPath,                           \"playlists\");    ....    Folder folder = new PlaylistsFolder   {     Path = path   };    if (folder.Id.IsEmpty())   {     if (string.IsNullOrEmpty(folder.Path))     {       ....     }     ....   }   .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V3022 Expression &#8216;string.IsNullOrEmpty(folder.Path)&#8217; is always false. LibraryManager.cs 754<\/p>\n<p>\u0412\u043e \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0435 \u043c\u0435\u0442\u043e\u0434 <code>Combine()<\/code> \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <code>string<\/code>. \u0415\u0441\u043b\u0438 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0438\u0437 \u043f\u0443\u0442\u0435\u0439 \u0431\u0443\u0434\u0435\u0442 <code>null<\/code>, \u043e\u043d \u0432\u044b\u0434\u0430\u0441\u0442 <code>ArgumentNullException<\/code> \u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0432\u0435\u0440\u043d\u0451\u0442. \u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043d\u0438\u0436\u0435:<\/p>\n<pre><code class=\"cs\">public static string Combine(string path1, string path2) {   if (path1 == null || path2 == null)   {     throw new ArgumentNullException((path1 == null) ? \"path1\" : \"path2\");   }    CheckInvalidPathChars(path1);   CheckInvalidPathChars(path2);   return CombineNoChecks(path1, path2); } <\/code><\/pre>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u0435\u0442\u043e\u0434 <code>Combine()<\/code> \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u0435\u0440\u043d\u0451\u0442 <code>string<\/code>. \u0415\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <code>Path<\/code>. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, <code>Path<\/code> \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c <code>null<\/code>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044d\u0442\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043b\u0438\u0448\u043d\u044f\u044f.<\/p>\n<p><strong>Issue 7<\/strong><\/p>\n<pre><code class=\"cs\">private async Task&lt;ActionResult&gt; GetMasterPlaylistInternal(....) {   ....   if (EnableAdaptiveBitrateStreaming(state, ....)   {     ....   } } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V3022 Expression is always false. DynamicHlsHelper.cs 268<\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442, \u0447\u0442\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u0441\u0435\u0433\u0434\u0430 <code>false<\/code>. \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c, \u0432 \u0447\u0451\u043c \u043e\u0448\u0438\u0431\u043a\u0430, \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u0432 \u043c\u0435\u0442\u043e\u0434 <code>EnableAdaptiveBitrateStreaming()<\/code>. \u0415\u0433\u043e \u043a\u043e\u0434 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043d\u0438\u0436\u0435:<\/p>\n<pre><code class=\"cs\">private bool EnableAdaptiveBitrateStreaming(StreamState state,....) {   if (....)   {     return false;   }      if (....)   {     return false;   }    if (....)   {     return false;   }      if (....)   {     return false;   }    if (....)   {     return false;   }    if (....)   {     return false;   }      \/\/ Having problems in android   return false;   \/\/ return state.VideoRequest.VideoBitRate.HasValue; } <\/code><\/pre>\n<p>\u0410 \u0432\u043e\u0442 \u0438 \u043e\u0448\u0438\u0431\u043a\u0430! \u041c\u0435\u0442\u043e\u0434 \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <code>false<\/code>. \u041d\u0430\u0432\u0435\u0440\u043d\u043e, \u0430\u0432\u0442\u043e\u0440 \u043d\u0430 \u0432\u0440\u0435\u043c\u044f \u0444\u0438\u043a\u0441\u0430 \u0440\u0435\u0448\u0438\u043b \u0432\u044b\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043b \u043a \u0431\u0430\u0433\u0430\u043c, \u0430 \u043f\u043e\u0442\u043e\u043c \u0437\u0430\u0431\u044b\u043b \u0435\u0433\u043e \u0440\u0430\u0441\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u0421\u0443\u0434\u044f \u043f\u043e \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044e, \u043a\u043e\u0434 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u043d\u0430 Android.<\/p>\n<p>\u041e \u0442\u0430\u043a\u0438\u0445 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445 \u043c\u043e\u0436\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u0437\u0430\u0431\u044b\u0442\u044c \u0438 \u043f\u043e\u0442\u0435\u0440\u044f\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043b\u0443\u0447\u0448\u0435 \u043b\u0438\u0448\u043d\u0438\u0439 \u0440\u0430\u0437 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0441\u0432\u043e\u0438 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0432 \u043a\u043e\u0434\u0435.<\/p>\n<p><strong>Issue 8<\/strong><\/p>\n<pre><code class=\"cs\">private string GetCommandLineArgs(MediaSourceInfo mediaSource,  string inputTempFile, string targetFile) {   ....   if (EncodeVideo(mediaSource))  \/\/ &lt;=   {     const int MaxBitrate = 25000000;     videoArgs = string.Format(CultureInfo.InvariantCulture,                \"-codec:v:0 libx264 -force_key_frames \\                \"expr:gte(t,n_forced*5)\\\" {0}                 -pix_fmt yuv420p -preset superfast -crf 23                -b:v {1} -maxrate {1} -bufsize ({1}*2) -profile:v high                 -level 41\",GetOutputSizeParam(),MaxBitrate);   }   .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V3022 Expression &#8216;EncodeVideo(mediaSource)&#8217; is always false. EncodedRecorder.cs 128<\/p>\n<p>\u0422\u0430\u043a\u0430\u044f \u0436\u0435 \u043e\u0448\u0438\u0431\u043a\u0430, \u0447\u0442\u043e \u0438 \u0432\u044b\u0448\u0435. \u041f\u043e \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c\u0443 \u043e\u043f\u044b\u0442\u0443 \u043f\u043e\u0438\u0449\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0443 \u0432 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0435 <code>EncodeVideo()<\/code>:<\/p>\n<pre><code class=\"cs\">private static bool EncodeVideo(MediaSourceInfo mediaSource) {   return false; } <\/code><\/pre>\n<p>\u041c\u0435\u0442\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <code>false<\/code>?! \u0417\u0430\u0447\u0435\u043c \u0442\u043e\u0433\u0434\u0430 \u0431\u044b\u043b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0432\u0435\u0441\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0432 <code>if()<\/code>? \u0412 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u043d\u043e\u0433\u043e \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u044b\u043c\u0438, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0437\u0430\u0431\u044b\u0442\u044c \u043e \u043d\u0451\u043c. \u0412 \u0442\u0430\u043a\u0438\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f\u0445 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 PVS-Studio. \u041e\u043d \u043b\u0435\u0433\u043a\u043e \u043d\u0430\u0448\u0451\u043b \u0434\u0432\u0435 \u043e\u0448\u0438\u0431\u043a\u0438, \u0433\u0434\u0435 \u0430\u0432\u0442\u043e\u0440 \u043c\u043e\u0433 \u0443\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0438\u0437-\u0437\u0430 \u0437\u0430\u0431\u044b\u0432\u0447\u0438\u0432\u043e\u0441\u0442\u0438.<\/p>\n<h4>\u041e\u0448\u0438\u0431\u043a\u0438 \u0441 NRE<\/h4>\n<p>\u041e\u0448\u0438\u0431\u043a\u0438 \u043f\u0440\u0438 \u043d\u0435\u0432\u0435\u0440\u043d\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0431\u0435\u0437 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0430 <code>null<\/code>, \u0438\u0437-\u0437\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c <code>NullReferenceException<\/code>.<\/p>\n<p><strong>Issue 9<\/strong><\/p>\n<pre><code class=\"cs\">protected override async Task&lt;AuthenticateResult&gt; HandleAuthenticateAsync() {   ....   if (authorizationInfo.IsApiKey ||        authorizationInfo.User.HasPermission(PermissionKind.IsAdministrator))   {     ....   }      var claims = new[]   {     new Claim(ClaimTypes.Name,               authorizationInfo.User?.Username ?? string.Empty),     ....   };   .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3095\/\">V3095<\/a> The &#8216;authorizationInfo.User&#8217; object was used before it was verified against null. Check lines: 53, 60. CustomAuthenticationHandler.cs 53<\/p>\n<p>\u0410\u0432\u0442\u043e\u0440 \u0443\u043f\u0443\u0441\u0442\u0438\u043b \u043e\u0448\u0438\u0431\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a NRE. \u0417\u0434\u0435\u0441\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0432\u044b\u0437\u043e\u0432 \u043c\u0435\u0442\u043e\u0434\u0430 <code>authorizationInfo.User.HasPermission(PermissionKind.IsAdministrator)<\/code>. \u0415\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <code>authorizationInfo.User<\/code> \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>null<\/code>, \u0442\u043e \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0435\u0451 \u043c\u0435\u0442\u043e\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 NRE. \u0414\u0430, \u0430\u0432\u0442\u043e\u0440 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u044d\u0442\u0443 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e, \u043d\u043e \u043d\u0435 \u0432 \u0442\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u2014 \u043e\u0448\u0438\u0431\u043a\u0430 NRE \u043c\u043e\u0433\u043b\u0430 \u0443\u0436\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0442\u0438.<\/p>\n<p><strong>Issue 10<\/strong><\/p>\n<pre><code class=\"cs\">private void BuildStreamVideoItem(....) {   ....   if (maxBitrateSetting.HasValue)   {     ....     playlistItem.VideoBitrate = Math.Max(Math.Min(availableBitrateForVideo,                                  currentValue), 64_000);   }   _logger.LogDebug(       ....       playlistItem?.PlayMethod,       ....); } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3095\/\">V3095<\/a> The &#8216;playlistItem&#8217; object was used before it was verified against null. Check lines: 1077, 1084. StreamBuilder.cs 1077<\/p>\n<p>\u0422\u0430\u043a\u0430\u044f \u0436\u0435 \u043e\u0448\u0438\u0431\u043a\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <code>playlistItem<\/code>, \u0430 \u043f\u043e\u0442\u043e\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0435\u0451 \u043d\u0430 <code>null<\/code>. \u042d\u0442\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u0442\u043e\u0436\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a NRE.<\/p>\n<h4>\u041e\u0448\u0438\u0431\u043a\u0430 copy-paste<\/h4>\n<p>\u041e\u0448\u0438\u0431\u043a\u0430 copy-paste, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043d\u0435 \u0437\u0430\u043c\u0435\u0442\u0438\u043b \u0438\u0437-\u0437\u0430 \u043d\u0435\u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438. \u0412 \u0438\u0442\u043e\u0433\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0435 \u0442\u0430\u043a, \u043a\u0430\u043a \u043e\u0436\u0438\u0434\u0430\u043b\u043e\u0441\u044c.<\/p>\n<p><strong>Issue 11<\/strong><\/p>\n<pre><code class=\"cs\">private void FetchBdInfo(....) {   ....   if (blurayVideoStream is not null &amp;&amp; ffmpegVideoStream is not null)   {     ....     blurayVideoStream.Width = blurayVideoStream.Width.GetValueOrDefault()           == 0 ? ffmpegVideoStream.Width : blurayVideoStream.Width;      blurayVideoStream.Height = blurayVideoStream.Height.GetValueOrDefault()           == 0 ? ffmpegVideoStream.Width : blurayVideoStream.Height;     ....   } } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3127\/\">V3127<\/a> Two similar code fragments were found. Perhaps, this is a typo and &#8216;Height&#8217; variable should be used instead of &#8216;Width&#8217; FFProbeVideoInfo.cs 357<\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 PVS-Studio \u0432\u044b\u0434\u0430\u043b \u043e\u0448\u0438\u0431\u043a\u0443 \u043e\u0431 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0445 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430\u0445 \u043a\u043e\u0434\u0430. \u0412\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u043e\u043d\u0430, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0438\u0437-\u0437\u0430 \u043d\u0435\u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438\u043b\u0438 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u0415\u0441\u043b\u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u0441\u043e \u0441\u0442\u0440\u043e\u043a\u043e\u0439 \u0432\u044b\u0448\u0435, \u0442\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <code>ffmpegVideoStream.Height<\/code>, \u043d\u043e \u043e\u0448\u0438\u0431\u0441\u044f \u0438 \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043b \u0438\u0437 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 <code>ffmpegVideoStream.Width<\/code>. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435 \u0442\u043e\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u0434\u0443\u043c\u044b\u0432\u0430\u043b \u0430\u0432\u0442\u043e\u0440. \u041e\u0448\u0438\u0431\u043a\u0430 copy-paste \u0443\u0436\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b\u0430\u0441\u044c \u0432 \u0434\u0440\u0443\u0433\u043e\u0439 <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/csharp\/0708\/\">\u0441\u0442\u0430\u0442\u044c\u0435<\/a>, \u043e\u043d\u0430 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0447\u0430\u0441\u0442\u043e \u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432.<\/p>\n<h4>\u041e\u0448\u0438\u0431\u043a\u0430 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0441\u0442\u0440\u043e\u043a\u0438<\/h4>\n<p>\u042d\u0442\u0443 \u043e\u0448\u0438\u0431\u043a\u0443 \u0430\u0432\u0442\u043e\u0440 \u043d\u0435 \u0437\u0430\u043c\u0435\u0442\u0438\u043b. \u041d\u043e \u043e\u043d\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u043f\u043e\u0442\u0435\u0440\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0438\u0437 \u043e\u043f\u043e\u0432\u0435\u0449\u0435\u043d\u0438\u044f.<\/p>\n<p><strong>Issue 12<\/strong><\/p>\n<pre><code class=\"cs\">public static byte MaskToCidr(IPAddress mask) {   ....   if (!mask.TryWriteBytes(bytes, out var bytesWritten))   {     Console.WriteLine(\"Unable to write address bytes,                         only ${bytesWritten} bytes written.\");   }   .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3138\/\">V3138<\/a> String literal contains potential interpolated expression. Consider inspecting: bytesWritten. NetworkUtils.cs 105<\/p>\n<p>\u0422\u0443\u0442, \u043f\u043e \u043b\u043e\u0433\u0438\u043a\u0435 \u043a\u043e\u0434\u0430, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u0431\u0430\u0439\u0442\u043e\u0432 (<code>bytesWritten<\/code>). \u0427\u0442\u043e\u0431\u044b \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u043d\u0443\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0432 \u043a\u0430\u0432\u044b\u0447\u043a\u0438. \u0411\u0435\u0437 \u043a\u0430\u0432\u044b\u0447\u0435\u043a \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u044d\u0442\u0443 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043a\u0430\u043a \u0441\u0442\u0440\u043e\u043a\u0443. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0443\u0432\u0438\u0434\u0438\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0442\u0440\u043e\u043a\u0443 \u0441 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0438 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442 \u043d\u0443\u0436\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0424\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u044f\u0432\u043d\u043e \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u043e. \u042d\u0442\u043e \u0447\u0435\u043b\u043e\u0432\u0435\u0447\u0435\u0441\u043a\u0438\u0439 \u0444\u0430\u043a\u0442\u043e\u0440, \u0438\u0437-\u0437\u0430 \u0443\u0441\u0442\u0430\u043b\u043e\u0441\u0442\u0438 \u0438\u043b\u0438 \u043d\u0435\u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043c\u044b \u0432\u0441\u0435 \u043c\u043e\u0436\u0435\u043c \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0438 \u043d\u0435 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438. \u0421\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 PVS-Studio \u0438\u0445 \u043d\u0435 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u0442.<\/p>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u041c\u0435\u0434\u0438\u0430\u0441\u0435\u0440\u0432\u0435\u0440 Jellyfin \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u0435\u043d \u0441\u0440\u0435\u0434\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0435\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0446\u0438\u044e \u043c\u0435\u0434\u0438\u0430\u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0441\u0435\u0442\u0435\u0432\u044b\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430. \u0421\u0435\u0440\u0432\u0435\u0440 \u0447\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u0444\u0438\u043b\u044c\u043c\u043e\u0432.<\/p>\n<p>\u041f\u0440\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 \u0431\u044b\u043b\u043e \u043d\u0430\u0439\u0434\u0435\u043d\u043e \u043d\u0435\u043c\u0430\u043b\u043e \u043e\u0448\u0438\u0431\u043e\u043a. \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435, \u043a\u0430\u043a \u043c\u044b \u0443\u0432\u0438\u0434\u0435\u043b\u0438, \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u043f\u0430\u0434\u0435\u043d\u0438\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0438\u043b\u0438 \u043f\u043e\u0442\u0435\u0440\u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u0430 \u044d\u0442\u043e \u0441\u0435\u0440\u044c\u0451\u0437\u043d\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430.<\/p>\n<p>\u041f\u0440\u043e\u0435\u043a\u0442 \u043f\u043e\u043b\u0435\u0437\u0435\u043d \u0434\u043b\u044f \u043c\u043d\u043e\u0433\u0438\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u043d\u0430\u0439\u0442\u0438 \u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438, \u0447\u0442\u043e\u0431\u044b \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u0434\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441\u0442\u0430\u043b\u043e \u043b\u0443\u0447\u0448\u0435.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0441\u0432\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043e\u0448\u0438\u0431\u043e\u043a, \u0442\u043e \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430\u0448\u0438\u043c <a href=\"https:\/\/pvs-studio.ru\/ru\/pvs-studio\/try-free\/?utm_source=website&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=1210\">\u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u043c PVS-Studio<\/a>.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435\u0439 \u0441 \u0430\u043d\u0433\u043b\u043e\u044f\u0437\u044b\u0447\u043d\u043e\u0439 \u0430\u0443\u0434\u0438\u0442\u043e\u0440\u0438\u0435\u0439, \u0442\u043e \u043f\u0440\u043e\u0448\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043f\u0435\u0440\u0435\u0432\u043e\u0434: Nikita Sviridov. <a href=\"https:\/\/pvs-studio.com\/en\/blog\/posts\/csharp\/1210\/\">Ode to one diagnostic rule and to couple more, or Jellyfin check<\/a>.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/875308\/\"> https:\/\/habr.com\/ru\/articles\/875308\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>Jellyfin \u2014 \u044d\u0442\u043e \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0439 \u043c\u0435\u0434\u0438\u0430\u0441\u0435\u0440\u0432\u0435\u0440 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043e\u0439 Emby \u0438 Plex. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0443, \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u044b\u043b\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0439 \u0432 \u043a\u043e\u0434\u0435 Jellyfin. \u0418 \u0435\u0449\u0451 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0448\u0438\u0431\u043e\u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<figure class=\"\"><\/figure>\n<h3>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0435<\/h3>\n<p><a href=\"https:\/\/jellyfin.org\/\">Jellyfin<\/a> \u0441\u043e\u0437\u0434\u0430\u043d \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0440\u0435\u043b\u0438\u0437\u0430 Emby 3.5.2 \u0438 \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0451\u043d \u043d\u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443 .NET Core \u0434\u043b\u044f \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u043d\u043e\u0439 \u043a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u043e\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438.<\/p>\n<p>\u0418\u0434\u0435\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0434\u0438\u0430\u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043c\u043e\u0433\u0430\u0442\u044c \u0432 \u0441\u0431\u043e\u0440\u0435 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0432\u0441\u0435\u043c\u0438 \u043c\u0435\u0434\u0438\u0430-\u0444\u0430\u0439\u043b\u0430\u043c\u0438 \u0438\u0437 \u043e\u0434\u043d\u043e\u0433\u043e \u0438 \u0442\u043e\u0433\u043e \u0436\u0435 \u043c\u0435\u0441\u0442\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u043a\u043e\u0433\u0434\u0430 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0435 \u0441\u0435\u0440\u0432\u0435\u0440, \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0441\u0435 \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u0434\u043e\u043b\u0436\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 \u0444\u0438\u043b\u044c\u043c\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432\u044b\u0431\u043e\u0440\u0430 \u0444\u0438\u043b\u044c\u043c\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0445\u043e\u0442\u0438\u0442\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u043d\u0430 \u043f\u0430\u043d\u0435\u043b\u0438 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 (\u0440\u0435\u0439\u0442\u0438\u043d\u0433, \u0436\u0430\u043d\u0440\u044b, \u0438\u043c\u044f, \u0441\u0442\u0443\u0434\u0438\u0438 \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435). \u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0444\u0430\u0439\u043b\u044b \u0441\u0443\u0431\u0442\u0438\u0442\u0440\u043e\u0432 \u0438\u0437 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432.<\/p>\n<p>\u041f\u0440\u043e\u0435\u043a\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 Emby, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441 \u0434\u0435\u043a\u0430\u0431\u0440\u044f 2018 \u0433\u043e\u0434\u0430 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043c\u0443\u043b\u044c\u0442\u0438\u043c\u0435\u0434\u0438\u0439\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c. \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c Jellyfin \u0438 \u043d\u0430\u0441\u043b\u0430\u0434\u0438\u0442\u044c\u0441\u044f \u0432\u0441\u0435\u043c\u0438 \u0435\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442 \u043d\u0430\u0447\u0430\u0442\u044c \u0441\u043e \u0441\u0432\u0435\u0436\u0435\u0439 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0441\u043a\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438.<\/p>\n<p>\u041c\u0435\u0434\u0438\u0430\u0441\u0435\u0440\u0432\u0435\u0440 Jellyfin \u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u0440\u0435\u0434\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u043d\u043e \u0440\u0430\u043d\u0435\u0435 \u043d\u0435 \u0431\u044b\u043b \u0437\u0430\u043c\u0435\u0447\u0435\u043d PVS-Studio. \u0425\u043e\u0442\u044f \u0435\u0433\u043e \u043f\u0440\u0430\u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c \u2014 \u043f\u0440\u043e\u0435\u043a\u0442 Emby \u2014 \u0431\u044b\u043b <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/csharp\/0705\/\">\u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d \u043d\u0430\u0448\u0438\u043c \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u043c<\/a>. \u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 PVS-Studio \u0434\u043e\u0431\u0440\u0430\u043b\u0441\u044f \u0438 \u0434\u043e Jellyfin. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0435\u0440\u0435\u0439\u0434\u0451\u043c \u043a \u043e\u0448\u0438\u0431\u043a\u0430\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u0414\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 Jellyfin, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0434\u043b\u044f \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u043d\u0430 <a href=\"https:\/\/github.com\/jellyfin\/jellyfin\/tree\/v10.9.11\">GitHub<\/a>.<\/p>\n<h3>\u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0430 V3022<\/h3>\n<p>V3022 \u2014 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b\u0430 \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u043e\u0448\u0438\u0431\u043e\u043a \u0432 \u044d\u0442\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435. \u0427\u0442\u043e\u0431\u044b \u043b\u0443\u0447\u0448\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u043a\u0430\u043a \u043e\u043d\u0430 \u0442\u0430\u043a \u0445\u043e\u0440\u043e\u0448\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0430 \u0441\u0435\u0431\u044f \u0432 \u044d\u0442\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u043e\u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/p>\n<p>\u0412 \u043e\u0441\u043d\u043e\u0432\u0435 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0438 V3022 \u043b\u0435\u0436\u0438\u0442 \u0430\u043d\u0430\u043b\u0438\u0437 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 (data flow \u0430\u043d\u0430\u043b\u0438\u0437). \u0410\u043d\u0430\u043b\u0438\u0437 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u2014 \u044d\u0442\u043e \u043c\u0435\u0442\u043e\u0434\u0438\u043a\u0430, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0430\u044f \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c\u0443 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0443 \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0438 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0447\u0430\u0441\u0442\u044f\u0445 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430. \u041f\u043e\u0434 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u043c\u044b\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u043f\u043e\u043d\u0438\u043c\u0430\u044e\u0442\u0441\u044f \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u044b \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0438\u043b\u0438 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439. \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0442\u043e\u043c, \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0430 \u043f\u0430\u043c\u044f\u0442\u044c \u043f\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044e \u0438\u043b\u0438 \u043d\u0435\u0442, \u043a\u0430\u043a\u043e\u0432\u044b \u0440\u0430\u0437\u043c\u0435\u0440\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435.<\/p>\n<p>\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u0445 \u0441\u0442\u0440\u043e\u044f\u0442\u0441\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043f\u043e \u0433\u0440\u0430\u0444\u0443 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b (control flow graph). \u0412 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0437\u043d\u0430\u0442\u044c \u0442\u043e\u0447\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0438\u043b\u0438 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f. \u041d\u043e \u043e\u043d \u043c\u043e\u0436\u0435\u0442, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u0440\u044f\u043c\u044b\u0435 \u0438 \u043a\u043e\u0441\u0432\u0435\u043d\u043d\u044b\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f, \u043d\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u043c\u044b\u0435 \u043d\u0430 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u044b\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043f\u043e \u0445\u043e\u0434\u0443 \u043e\u0431\u0445\u043e\u0434\u0430 \u0433\u0440\u0430\u0444\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043e \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430\u0445 \u0438\u043b\u0438 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044d\u0442\u0438 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0442\u043e\u0447\u043a\u0430\u0445 \u0433\u0440\u0430\u0444\u0430.<\/p>\n<p>\u0412\u0441\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u044b PVS-Studio \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 data flow \u0430\u043d\u0430\u043b\u0438\u0437 \u0434\u043b\u044f \u0443\u0442\u043e\u0447\u043d\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u0432\u043e\u0438\u0445 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0440\u0430\u0432\u0438\u043b. \u042d\u0442\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432 \u0441\u043b\u0443\u0447\u0430\u044f\u0445, \u043a\u043e\u0433\u0434\u0430 \u0434\u043b\u044f \u043f\u0440\u0438\u043d\u044f\u0442\u0438\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0439 \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437 AST \u0438\u043b\u0438 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u044d\u0442\u043e\u0433\u043e \u043a\u043e\u0434\u0430.<\/p>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f\u0445 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 PVS-Studio \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0437\u043d\u0430\u0442\u044c <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/0908\/\">\u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435<\/a>.<\/p>\n<h3>\u041e\u0448\u0438\u0431\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/h3>\n<h4>\u041e\u0448\u0438\u0431\u043a\u0438 \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u0438<\/h4>\n<p>\u041a\u0430\u043a \u0431\u044b\u043b\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0432\u044b\u0448\u0435, \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0439 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043d\u0430 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0443 V3022. \u0418\u043c \u0438 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u0430 \u0441\u0442\u0430\u0442\u044c\u044f. \u041d\u043e \u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0435\u0449\u0451 \u043f\u0430\u0440\u043e\u0447\u043a\u0443 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0439, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0435\u0441\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u0432\u0438\u0434\u044b \u043e\u0448\u0438\u0431\u043e\u043a.<\/p>\n<p>\u0412\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u043e\u0448\u0438\u0431\u043e\u043a \u0432 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0438 V3022 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e: \u0432\u0437\u0430\u0438\u043c\u043e\u0438\u0441\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0438\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438, \u043e\u0448\u0438\u0431\u043a\u0430 \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u0438, \u0432\u0441\u0435\u0433\u0434\u0430 \u0438\u0441\u0442\u0438\u043d\u043d\u043e\u0435\/\u043b\u043e\u0436\u043d\u043e\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435. \u041d\u043e \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u0432\u0441\u0451 \u044d\u0442\u043e \u043a \u043e\u0448\u0438\u0431\u043a\u0430\u043c \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445.<\/p>\n<p><strong>Issue 1<\/strong><\/p>\n<pre><code class=\"cs\">private void ApplyTranscodingConditions(....) {   ....    if (condition.Condition ==                       ProfileConditionType.GreaterThanEqual)  \/\/ &lt;=   {     continue;   }    switch (condition.Property)   {     case ProfileConditionValue.AudioBitrate:     {       ....       else if (condition.Condition ==                               ProfileConditionType.GreaterThanEqual)  \/\/ &lt;=       {         ....                               }        break;     }      case ProfileConditionValue.AudioSampleRate:     {       ....       else if (condition.Condition ==                               ProfileConditionType.GreaterThanEqual)  \/\/ &lt;=       {         ....                               }        break;       ....     }   } } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3022\/\">V3022<\/a> Expression &#8216;condition.Condition == ProfileConditionType.GreaterThanEqual&#8217; is always false. StreamBuilder.cs 2193<\/p>\n<p>\u042d\u0442\u043e \u0441\u0430\u043c\u0430\u044f \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u0410\u0432\u0442\u043e\u0440 \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u043b \u0435\u0451 \u0432 10 \u0431\u043b\u043e\u043a\u0430\u0445 case! \u0412 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u0437 \u043d\u0438\u0445 \u2014 \u043e\u0448\u0438\u0431\u043a\u0430 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u0430\u044f \u0432\u043e \u0432\u0441\u0435\u0445 \u0431\u043b\u043e\u043a\u0430\u0445.<\/p>\n<p>\u0412\u0441\u0451 \u0438\u0437-\u0437\u0430 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b. \u0415\u0441\u043b\u0438 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 <code>condition.Condition == ProfileConditionType.GreaterThanEqual<\/code> \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>true<\/code>, \u0442\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u0432\u043d\u0443\u0442\u0440\u044c \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0438 \u043f\u0435\u0440\u0435\u0439\u0434\u0451\u0442 \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438 \u0446\u0438\u043a\u043b\u0430, \u0442\u0430\u043a \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <code>continue<\/code>. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043d\u0438\u0436\u0435, \u0432 \u0431\u043b\u043e\u043a\u0430\u0445 <code>case<\/code>, \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 <code>true<\/code>. \u041a\u043e\u0434 \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0438\u0445 \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0441\u044f. \u0410\u0432\u0442\u043e\u0440 \u0437\u0430\u0431\u044b\u043b \u043e \u043f\u0435\u0440\u0432\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 \u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u043b \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0443 \u0432 10 \u0431\u043b\u043e\u043a\u043e\u0432 <code>case<\/code>. \u041f\u043e\u0434\u043e\u0431\u043d\u043e\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u0442 \u043a \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0438 \u043f\u043e\u0442\u0435\u0440\u0435 \u0435\u0451 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430.<\/p>\n<p><strong>Issue 2<\/strong><\/p>\n<pre><code class=\"cs\">private static bool AllowBoxSetCollapsing(InternalItemsQuery request) {   ....   if (request.IsResumable.HasValue)   {     return false;   }    if (request.IsFolder.HasValue)   {     return false;   }    if (request.Genres.Count &gt; 0)   {     return false;   }    if (request.GenreIds.Count &gt; 0)  \/\/ &lt;=   {     return false;   }    ....    if (request.GenreIds.Count &gt; 0)  \/\/ &lt;=   {     return false;   }    .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3022\/\">V3022<\/a> Expression &#8216;request.GenreIds.Count &gt; 0&#8217; is always false. Folder.cs 1243<\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442 \u043e \u043b\u0438\u0448\u043d\u0438\u043c \u0443\u0441\u043b\u043e\u0432\u0438\u0438. \u0410\u0432\u0442\u043e\u0440 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <code>request.GenreIds.Count<\/code>, \u0430 \u043f\u043e\u0442\u043e\u043c \u043d\u0438\u0436\u0435 \u0441\u0434\u0435\u043b\u0430\u043b \u044d\u0442\u043e \u0435\u0449\u0451 \u0440\u0430\u0437. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u043e\u043d \u0445\u043e\u0442\u0435\u043b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0434\u0440\u0443\u0433\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0438 \u043d\u0435 \u0437\u0430\u043c\u0435\u0442\u0438\u043b \u043e\u0448\u0438\u0431\u043a\u0438.<\/p>\n<p><strong>Issue 3<\/strong><\/p>\n<pre><code class=\"cs\">private IReadOnlyList&lt;BaseItem&gt; GetItemsForLatestItems(....) {   ....   if (parents.Count == 0)  \/\/ &lt;=   {     parents = _libraryManager.GetUserRootFolder().GetChildren(user, true)       .Where(i =&gt; i is Folder)       .Where(i =&gt; !user.GetPreferenceValues&lt;Guid&gt;                         PreferenceKind.LatestItemExcludes)       .Contains(i.Id))       .ToList();   }    if (parents.Count == 0)  \/\/ &lt;=   {     return Array.Empty&lt;BaseItem&gt;();   }   ....   if (parents.Count == 0)  \/\/ &lt;=   {     return _libraryManager.GetItemList(query, false);   } } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V3022 Expression &#8216;parents.Count == 0&#8217; is always false. UserViewManager.cs 372<\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u0430\u0432\u0442\u043e\u0440 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 <code>parents.Count<\/code>. \u0415\u0441\u043b\u0438 \u043e\u043d\u043e \u0440\u0430\u0432\u043d\u043e 0, \u0442\u043e \u043e\u043d \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442 <code>parents<\/code> \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438. \u041f\u043e\u043a\u0430 \u0432\u0441\u0451 \u043b\u043e\u0433\u0438\u0447\u043d\u043e. \u0417\u0430\u0442\u0435\u043c \u043e\u043d \u0432\u0442\u043e\u0440\u043e\u0439 \u0440\u0430\u0437 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <code>parents.Count<\/code>, \u0432\u0434\u0440\u0443\u0433 \u043d\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u043b\u0430\u0441\u044c. \u0421\u043d\u043e\u0432\u0430 \u043b\u043e\u0433\u0438\u0447\u043d\u043e. \u041f\u043e\u0442\u043e\u043c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0442\u0440\u0435\u0442\u044c\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430, \u0447\u0442\u043e\u0431\u044b \u0442\u043e\u0447\u043d\u043e \u043d\u0435 \u043e\u0448\u0438\u0431\u0438\u0442\u044c\u0441\u044f. \u041d\u043e, \u0432\u0438\u0434\u0438\u043c\u043e, \u0430\u0432\u0442\u043e\u0440 \u043d\u0435 \u0443\u0447\u0451\u043b, \u0447\u0442\u043e \u043f\u043e\u0441\u043b\u0435 \u0432\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438, \u043f\u0440\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0438 <code>parents.Count<\/code> \u0440\u0430\u0432\u043d\u043e\u043c 0, \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0432\u0435\u0440\u043d\u0451\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>Array.Empty&lt;BaseItem&gt;()<\/code> \u0438 \u0432\u044b\u0439\u0434\u0435\u0442 \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0434\u043e\u0439\u0434\u0451\u0442 \u0434\u043e \u0442\u0440\u0435\u0442\u044c\u0435\u0433\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u044f, \u043e\u043d\u043e \u0437\u0434\u0435\u0441\u044c \u043b\u0438\u0448\u043d\u0435\u0435.<\/p>\n<p><strong>Issue 4<\/strong><\/p>\n<pre><code class=\"cs\">public override string CreatePresentationUniqueKey() {   if (IndexNumber.HasValue)   {     var series = Series;     if (series is not null)     {       return series.PresentationUniqueKey + \"-\" +                 (IndexNumber ?? 0).ToString(\"000\", CultureInfo.InvariantCulture);     }   }    return base.CreatePresentationUniqueKey(); } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V3022 Expression &#8216;IndexNumber&#8217; is always not null. The operator &#8216;??&#8217; is excessive. Season.cs 135<\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0435 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <code>IndexNumber<\/code>, \u0430 \u0437\u0430\u0442\u0435\u043c \u0441\u043d\u043e\u0432\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430 <code>null<\/code>. \u041d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u0430, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0435\u0441\u043b\u0438 \u043f\u043e\u043f\u0430\u043b\u0430 \u0432 \u044d\u0442\u043e\u0442 <code>if<\/code>.<\/p>\n<p>\u041f\u043e\u0445\u043e\u0436\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430, \u0441\u043d\u043e\u0432\u0430 \u0441 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u043c <em>??<\/em>.<\/p>\n<p><strong>Issue 5<\/strong><\/p>\n<pre><code class=\"cs\">private int? GetOutputVideoCodecLevel(StreamState state) {   string levelString = string.Empty;   if (EncodingHelper.IsCopyCodec(state.OutputVideoCodec)        &amp;&amp; state.VideoStream is not null        &amp;&amp; state.VideoStream.Level.HasValue)   {     levelString = state.VideoStream.Level.Value.                         ToString(CultureInfo.InvariantCulture) ?? string.Empty;   } } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V3022 Expression &#8216;state.VideoStream.Level.Value.ToString(CultureInfo.InvariantCulture)&#8217; is always not null. The operator &#8216;??&#8217; is excessive. DynamicHlsHelper.cs 619<\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442 \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0435 \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <code>??<\/code>. \u0410\u0432\u0442\u043e\u0440 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u043b, \u0447\u0442\u043e \u043e\u043d \u0438\u0437\u0431\u0430\u0432\u0438\u0442 \u043e\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <code>null<\/code>, \u0442\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u043e\u0442 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0441 <code>null<\/code>. \u041d\u043e \u043d\u0438 \u043c\u0435\u0442\u043e\u0434 <code>ToString()<\/code>, \u043d\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>string.Empty<\/code> \u043d\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 <code>null<\/code>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043b\u0438\u0448\u043d\u044f\u044f.<\/p>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043c\u0435\u0442\u043e\u0434 <code>ToString()<\/code>, \u0447\u0442\u043e\u0431\u044b \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043e\u043d \u043d\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <code>null<\/code>:<\/p>\n<pre><code class=\"cs\">public virtual string ToString() {   return GetType().ToString(); } <\/code><\/pre>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0438\u0436\u0435:<\/p>\n<pre><code class=\"cs\">public override string ToString() {   return \"Type: \" + Name; } <\/code><\/pre>\n<p>\u041f\u043e \u044d\u0442\u043e\u043c\u0443 \u043a\u043e\u0434\u0443 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u2014 \u0441\u0442\u0440\u043e\u043a\u0430. \u042d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u043d\u0435 \u0432\u0435\u0440\u043d\u0451\u0442 <code>null<\/code>.<\/p>\n<p><strong>Issue 6<\/strong><\/p>\n<pre><code class=\"cs\">public AggregateFolder CreateRootFolder() {   ....   var path = Path.Combine(_configurationManager.ApplicationPaths.DataPath,                           \"playlists\");    ....    Folder folder = new PlaylistsFolder   {     Path = path   };    if (folder.Id.IsEmpty())   {     if (string.IsNullOrEmpty(folder.Path))     {       ....     }     ....   }   .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V3022 Expression &#8216;string.IsNullOrEmpty(folder.Path)&#8217; is always false. LibraryManager.cs 754<\/p>\n<p>\u0412\u043e \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0435 \u043c\u0435\u0442\u043e\u0434 <code>Combine()<\/code> \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <code>string<\/code>. \u0415\u0441\u043b\u0438 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0438\u0437 \u043f\u0443\u0442\u0435\u0439 \u0431\u0443\u0434\u0435\u0442 <code>null<\/code>, \u043e\u043d \u0432\u044b\u0434\u0430\u0441\u0442 <code>ArgumentNullException<\/code> \u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0432\u0435\u0440\u043d\u0451\u0442. \u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043d\u0438\u0436\u0435:<\/p>\n<pre><code class=\"cs\">public static string Combine(string path1, string path2) {   if (path1 == null || path2 == null)   {     throw new ArgumentNullException((path1 == null) ? \"path1\" : \"path2\");   }    CheckInvalidPathChars(path1);   CheckInvalidPathChars(path2);   return CombineNoChecks(path1, path2); } <\/code><\/pre>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u0435\u0442\u043e\u0434 <code>Combine()<\/code> \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u0435\u0440\u043d\u0451\u0442 <code>string<\/code>. \u0415\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <code>Path<\/code>. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, <code>Path<\/code> \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c <code>null<\/code>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044d\u0442\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043b\u0438\u0448\u043d\u044f\u044f.<\/p>\n<p><strong>Issue 7<\/strong><\/p>\n<pre><code class=\"cs\">private async Task&lt;ActionResult&gt; GetMasterPlaylistInternal(....) {   ....   if (EnableAdaptiveBitrateStreaming(state, ....)   {     ....   } } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-445737","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/445737","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=445737"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/445737\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=445737"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=445737"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=445737"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}