Compare commits

..

592 Commits

Author SHA1 Message Date
Joshua Boniface
a15098dc00 Bump release version for last-minute PRs 2019-02-16 12:13:38 -05:00
Bond-009
86a4d15a32 Merge pull request #899 from AThomsen/bugfix/dlna_name_race_condition
DLNA: Fix race condition leading to missing device names
2019-02-16 11:07:30 +01:00
Andrew Rabert
b86f049e66 Merge pull request #910 from nvllsvm/make_it_so
Enhance Dockerfiles
2019-02-16 01:53:10 -05:00
Andrew Rabert
12fea24590 Merge pull request #911 from nvllsvm/hooked_on_phonics
Checkout submodules in Docker Hub hook
2019-02-16 01:53:01 -05:00
Andrew Rabert
26e2ffdd31 Checkout submodules in Docker Hub hook 2019-02-16 01:45:48 -05:00
Andrew Rabert
d9ab654abe Enhance Dockerfiles
* Prevent failure when obj exists from host compile
* Enhance readability of disposed stages
* Formatting
2019-02-16 01:37:55 -05:00
Andrew Rabert
c44f96b727 Merge pull request #909 from n8225/dockerBuilds
Fix docker arm builds
2019-02-16 01:34:37 -05:00
n8225
c5ac36c886 Fix docker arm builds 2019-02-15 23:34:16 -06:00
Joshua Boniface
ff9a0c7e55 Update submodule to 10.2.0 release 2019-02-15 21:04:20 -05:00
Joshua Boniface
056e19f350 Remove superfluous changelog entries 2019-02-15 21:04:12 -05:00
Joshua Boniface
f8ba55e202 Update version to 10.2.0 release 2019-02-15 20:52:54 -05:00
Joshua M. Boniface
4ea76f9cdc Merge pull request #883 from jellyfin/translations
Import Translations
2019-02-15 20:47:37 -05:00
Joshua M. Boniface
88f56cd0c4 Merge pull request #892 from joshuaboniface/depend-ffmpeg-version
Add jellyfin-ffmpeg and versioning to package deps
2019-02-15 20:40:29 -05:00
Bond-009
6d74184cfb Merge pull request #901 from cvium/dispose_webresponse_on_errors
Properly dispose HttpWebResponse when the request failed to avoid 'too many open files'
2019-02-16 00:15:59 +01:00
Claus Vium
2845e7e101 Properly dispose HttpWebResponse when the request failed to avoid 'too many open files' 2019-02-15 08:56:08 +01:00
WWWesten
c78298789d Translated using Weblate (Kazakh)
Currently translated at 100.0% (94 of 94 strings)

Translation: Jellyfin/Jellyfin
Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/kk/
2019-02-14 18:45:24 -05:00
Anders Thomsen
7bb8985f11 Fix race condition in adding dlna devices to session when the device is discovered repeatedly 2019-02-14 21:53:04 +01:00
Joshua Boniface
8414285b58 Only modify Debian package spec for jellyfin-ffmpeg 2019-02-14 09:15:37 -05:00
Joshua Boniface
7ec42b89a0 Correct changelogs for updated 10.2.0~rc2 2019-02-13 17:45:17 -05:00
Claus Vium
c720504e39 Drop ETag and use Last-Modified header (#890)
Drop ETag and use Last-Modified since performance is much better
2019-02-13 21:08:59 +01:00
Joshua Boniface
af8f86b3de Bump version to 10.2.0~rc2 2019-02-13 01:03:48 -05:00
Polydeukes
bfc3954995 Translated using Weblate (Spanish)
Currently translated at 100.0% (94 of 94 strings)

Translation: Jellyfin/Jellyfin
Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/es/
2019-02-13 00:45:21 -05:00
WWWesten
4ed90d4658 Translated using Weblate (Kazakh)
Currently translated at 100.0% (94 of 94 strings)

Translation: Jellyfin/Jellyfin
Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/kk/
2019-02-13 00:45:21 -05:00
ZsiGiT
3a6a5baa8e Translated using Weblate (Hungarian)
Currently translated at 100.0% (94 of 94 strings)

Translation: Jellyfin/Jellyfin
Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/hu/
2019-02-13 00:45:21 -05:00
Leo Verto
18f0d996c0 Translated using Weblate (German)
Currently translated at 100.0% (94 of 94 strings)

Translation: Jellyfin/Jellyfin
Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/de/
2019-02-13 00:45:21 -05:00
Claus Vium
da2554bd53 Translated using Weblate (Danish)
Currently translated at 100.0% (94 of 94 strings)

Translation: Jellyfin/Jellyfin
Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/da/
2019-02-13 00:45:21 -05:00
WWWesten
f2811323c2 Translated using Weblate (Kazakh)
Currently translated at 100.0% (94 of 94 strings)

Translation: Jellyfin/Jellyfin
Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/kk/
2019-02-13 00:45:21 -05:00
Vasily
221a95c93c Translated using Weblate (Russian)
Currently translated at 100.0% (94 of 94 strings)

Translation: Jellyfin/Jellyfin
Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/ru/
2019-02-12 20:37:16 +01:00
WWWesten
982ac32471 Translated using Weblate (Russian)
Currently translated at 100.0% (94 of 94 strings)

Translation: Jellyfin/Jellyfin
Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/ru/
2019-02-12 20:37:16 +01:00
Joshua Boniface
d48275a785 Translated using Weblate (English (United Kingdom))
Currently translated at 97.8% (92 of 94 strings)

Translation: Jellyfin/Jellyfin
Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/en_GB/
2019-02-12 20:37:16 +01:00
Stef Havermans
a4e98a0390 Translated using Weblate (Dutch)
Currently translated at 97.8% (92 of 94 strings)

Translation: Jellyfin/Jellyfin
Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/nl/
2019-02-12 20:37:16 +01:00
Stef Havermans
0fbdb79df7 Translated using Weblate (Dutch)
Currently translated at 88.2% (83 of 94 strings)

Translation: Jellyfin/Jellyfin
Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/nl/
2019-02-12 20:37:16 +01:00
Erwin de Haan
87dc60d4aa Translated using Weblate (Dutch)
Currently translated at 88.2% (83 of 94 strings)

Translation: Jellyfin/Jellyfin
Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/nl/
2019-02-12 20:37:16 +01:00
Sarah Zainalabidin
d6b56dde62 Translated using Weblate (Malay)
Currently translated at 98.9% (93 of 94 strings)

Translation: Jellyfin/Jellyfin
Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/ms/
2019-02-12 20:37:16 +01:00
Kowalski Prime
0302144b22 Translated using Weblate (Italian)
Currently translated at 98.9% (93 of 94 strings)

Translation: Jellyfin/Jellyfin
Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/it/
2019-02-12 20:37:16 +01:00
ZsiGiT
269b94254b Translated using Weblate (Hungarian)
Currently translated at 98.9% (93 of 94 strings)

Translation: Jellyfin/Jellyfin
Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/hu/
2019-02-12 20:37:16 +01:00
Hadrien Miche
2f377e0a0f Translated using Weblate (French)
Currently translated at 98.9% (93 of 94 strings)

Translation: Jellyfin/Jellyfin
Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/fr/
2019-02-12 20:37:16 +01:00
Erwin de Haan
3b96c78515 Translated using Weblate (English (United States))
Currently translated at 100.0% (94 of 94 strings)

Translation: Jellyfin/Jellyfin
Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/en_US/
2019-02-12 20:37:16 +01:00
bakkegaard
e150174ece Translated using Weblate (Danish)
Currently translated at 98.9% (93 of 94 strings)

Translation: Jellyfin/Jellyfin
Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/da/
2019-02-12 20:37:16 +01:00
Erwin de Haan
33e069e461 Translated using Weblate (Dutch)
Currently translated at 96.8% (91 of 94 strings)

Translation: Jellyfin/Jellyfin
Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/nl/
2019-02-12 20:37:16 +01:00
Vasily
593b7327cf Merge pull request #868 from WillWill56/fix_bss
Fix audio streaming via BaseProgressiveStreamingService
2019-02-12 17:52:54 +03:00
Joshua M. Boniface
9d795adc3e Merge pull request #872 from WillWill56/fix_sbnullref
Fix potential NullReferenceException
2019-02-12 09:12:18 -05:00
Joshua M. Boniface
0ff38b6012 Merge pull request #869 from cvium/only_zips
Remove DLL support and require all packages/plugins to be zip archives
2019-02-12 09:02:27 -05:00
William Lees
fe43e279c8 Add to contributors 2019-02-12 23:50:53 +11:00
William Lees
d18823ced1 Fix potential NullReferenceException 2019-02-12 23:28:02 +11:00
William Lees
db4a72df10 Reduce scope of changes 2019-02-12 09:23:51 +11:00
Claus Vium
406fb045c2 Change logging to match the action 2019-02-11 18:54:10 +01:00
Claus Vium
32992b6143 Add extra linebreak 2019-02-11 18:53:35 +01:00
Claus Vium
da169dddb5 Remove DLL support and require all packages/plugins to be zip archives 2019-02-11 18:52:09 +01:00
William Lees
250f03d2d9 add httpClient to more constructors 2019-02-12 00:42:33 +11:00
William Lees
d8cb34dbbc add httpClient to appropriate constructors 2019-02-12 00:24:00 +11:00
Anthony Lavado
8fd9f5b6a4 Merge pull request #864 from joshuaboniface/zipped-plugins
Add support for ZIP plugin archives
2019-02-11 00:22:32 -05:00
Joshua Boniface
2f4a00d322 Add support for ZIP plugin archives
Most code from @cvium. Also removes the lazy and ill-conceived GUID-
based checksumming, which just died with ZIP archives.
2019-02-10 17:29:55 -05:00
Joshua Boniface
9849c183ac Fix syntax error of additional brace 2019-02-10 21:42:37 +01:00
Joshua Boniface
bcb32ec6ad Bump version to 10.2.0~rc1 2019-02-10 02:08:12 -05:00
Joshua M. Boniface
eb4b705167 Merge pull request #852 from Bond-009/nuget
Use SQLitePCL.pretty.netstandard on NuGet
2019-02-09 21:51:14 -05:00
Joshua M. Boniface
d6c669a7c8 Merge pull request #824 from joshuaboniface/improved-docker-pkgbuild
Improved Docker pkgbuild
2019-02-09 20:58:56 -05:00
Joshua M. Boniface
1b84446831 Merge pull request #853 from joshuaboniface/fix-cache-reset
Fix poor handling of cache directories
2019-02-09 19:37:56 -05:00
Joshua Boniface
fb256b7aa0 Fix control file for Microsoft Docker setup 2019-02-09 19:32:06 -05:00
Joshua Boniface
382b8bb509 Use Path.Combine 2019-02-09 19:14:34 -05:00
Joshua Boniface
00234a5ece Remove superfluous comments 2019-02-09 19:12:55 -05:00
Joshua Boniface
57cefb432a Combine various RUNs in Fedora/CentOS 2019-02-09 19:06:27 -05:00
Joshua Boniface
7be4a8500c Use Microsoft dotnet Docker images 2019-02-09 19:02:27 -05:00
Joshua Boniface
74d2698c5f Fix poor handling of cache directories 2019-02-09 18:37:35 -05:00
Anthony Lavado
4727f69fc9 Merge pull request #807 from joshuaboniface/fix-restart
Fix restart script in OS packages
2019-02-09 15:43:00 -05:00
Anthony Lavado
1e6c41e333 Merge pull request #804 from joshuaboniface/fix-env
Handle new option parser properly
2019-02-09 15:39:52 -05:00
Bond_009
bee8f58265 Upgrade package versions 2019-02-09 21:32:59 +01:00
Bond_009
a71040ba1b Chnage to own NuGet package 2019-02-09 21:28:36 +01:00
Erwin de Haan
f1ef0b0b4c Fix namespacing so it lines up properly with file names and paths (#715)
* Fix stupid namespacing so it lines up properly with file names and paths.
2019-02-09 10:10:33 +01:00
Joshua M. Boniface
387b4dea25 Merge pull request #840 from Bond-009/requestcleanup
Fix more warnings
2019-02-08 22:02:17 -05:00
Joshua Boniface
3014866f65 Add similar Ubuntu build package 2019-02-08 21:08:34 -05:00
Joshua Boniface
37985c2e26 Update image name 2019-02-08 20:44:41 -05:00
Joshua Boniface
139e3c19ee Replace symlinks with copies and update image name 2019-02-08 20:43:18 -05:00
Joshua Boniface
da860e6e54 Remove superfluous VERSION variables 2019-02-08 20:40:19 -05:00
Claus Vium
ce03662fa7 Add error logging when translation is missing from core 2019-02-08 22:10:55 +01:00
Claus Vium
49923e50db Remove missing languages from localization options 2019-02-08 22:10:55 +01:00
Claus Vium
c3c52b6682 Default to en-US for missing core translations 2019-02-08 22:10:55 +01:00
Vasily
80281e599d Merge pull request #842 from nvllsvm/vaapi
Use VAAPI-enabled ffmpeg
2019-02-08 20:26:30 +03:00
Vasily
3a88a3c795 Merge pull request #822 from Bond-009/imagedimensions
Complete rename ImageSize -> ImageDimensions
2019-02-08 20:02:25 +03:00
Vasily
d6e98f9a50 Merge pull request #819 from Bond-009/cleanup
Some small changes in Device.cs and DidlBuilder.cs
2019-02-08 19:59:55 +03:00
Vasily
2bcbffee0c Merge pull request #841 from joshuaboniface/donation-badge
Fix OC badge to all and add forum badge
2019-02-08 11:32:48 +03:00
Andrew Rabert
22ffc5aee4 Use VAAPI-enabled ffmpeg 2019-02-08 00:19:31 -05:00
Andrew Rabert
ee3a4531a0 Merge pull request #831 from Bond-009/hashset
Move some arrays to generics
2019-02-08 00:08:35 -05:00
Joshua Boniface
aff740c596 Fix OC badge to all and add forum badge 2019-02-07 18:14:43 -05:00
Bond-009
38d9eeffbe Fix more warnings 2019-02-08 00:07:57 +01:00
Anthony Lavado
d6d9fce898 Merge pull request #838 from Bond-009/requestcleanup
Quick style fix
2019-02-07 17:56:21 -05:00
Bond-009
f60ad53393 Quick style fix 2019-02-07 23:36:44 +01:00
Joshua M. Boniface
e8461d3317 Merge pull request #834 from joshuaboniface/donation-badge
Add donation badge and reorganize badges
2019-02-07 08:31:21 -05:00
Joshua Boniface
9dd512df80 Add donation badge and reorganize badges 2019-02-06 20:09:55 -05:00
Joshua M. Boniface
5b0bd88892 Merge pull request #833 from cvium/fix_localization
Add await to GetCountries in LocalizationService
2019-02-06 17:04:11 -05:00
Bond_009
70c85925af Move some arrays to generics 2019-02-06 22:58:12 +01:00
Claus Vium
e449182641 Move import 2019-02-06 22:54:57 +01:00
Claus Vium
fcfe02ee73 Add await to GetCountries in LocalizationService 2019-02-06 22:40:49 +01:00
Joshua Boniface
b8b650540d Allow Fedora/CentOS mounting by default 2019-02-06 09:33:14 -05:00
Joshua Boniface
e1d523ee45 Improve description of keep_artifacts flag 2019-02-05 21:37:56 -05:00
Joshua Boniface
ceb8b9f740 Add explanation to usage output 2019-02-05 21:34:09 -05:00
Joshua Boniface
8413c56392 Update CentOS package build 2019-02-05 19:19:55 -05:00
Joshua Boniface
88038d9644 Update Fedora package build 2019-02-05 19:04:08 -05:00
Joshua Boniface
c846da4f9e Update Debian package build 2019-02-05 18:40:50 -05:00
Joshua Boniface
546f4cd46f Add prerequisite keep_artifacts var 2019-02-05 18:40:31 -05:00
Bond-009
e216702bcf Complete rename ImageSize -> ImageDimensions 2019-02-05 19:53:50 +01:00
Bond-009
be89a5e719 Don't rename method 2019-02-05 18:16:10 +01:00
Bond_009
84d56976ba Some small changes in Device.cs and DidlBuilder.cs
Device.cs:
* Improve dispose function
* Style fixes
* Remove unused field

DidlBuilder.cs:
* Remove unused field
* Replace giant if chain with a switch statement
2019-02-05 17:37:38 +01:00
Claus Vium
0ef2b46106 Remove custom Threading 2019-02-05 16:47:50 +01:00
Anthony Lavado
52294881b1 Merge pull request #812 from joshuaboniface/readme-links
Fix up the explicit docs links in the README
2019-02-04 20:29:52 -05:00
Joshua Boniface
5e8a2db029 Fix up the explicit docs links in the README 2019-02-04 18:29:44 -05:00
Vasily
262eefd8db Merge pull request #805 from joshuaboniface/translate
Add weblate translation status to README
2019-02-05 00:52:37 +03:00
Joshua Boniface
73e8758d84 Add weblate translation status to README 2019-02-04 16:31:47 -05:00
Vasily
181de97ce5 Merge pull request #810 from Bond-009/localization
Fix loading of rating files
2019-02-05 00:19:32 +03:00
Bond_009
ae5514afd6 Fix loading of rating files 2019-02-04 18:46:36 +01:00
Vasily
83af2db679 Merge pull request #798 from Bond-009/apientrypoint
Cleanup around the api endpoints
2019-02-04 14:10:08 +03:00
Vasily
0b3e6548db Merge pull request #797 from Bond-009/warnings
Fix all warnings
2019-02-04 14:08:21 +03:00
Joshua Boniface
72beadc74d Fix restart script for Fedora/CentOS 2019-02-04 00:27:00 -05:00
Joshua Boniface
f0e74c2c6b Fix restart script for Debian 2019-02-04 00:26:23 -05:00
Joshua Boniface
d351fa0c1e Make Fedora package.sh script use bash 2019-02-03 22:59:55 -05:00
Joshua M. Boniface
20033f2275 Merge branch 'master' into fix-env 2019-02-03 22:34:40 -05:00
Joshua M. Boniface
c4c0894b29 Merge pull request #800 from Wuerfelbecher/update-rpm
Add CentOS and update rpm spec for the cachedir option
2019-02-03 22:33:47 -05:00
Joshua M. Boniface
c4f51e16a5 Merge pull request #736 from Bond-009/startasync
Start startup tasks async
2019-02-03 22:23:54 -05:00
Joshua M. Boniface
56dcc45dc0 Merge pull request #732 from Bond-009/locale
Reworked LocalizationManager to load data async
2019-02-03 22:08:20 -05:00
Joshua Boniface
be89d53a9e Handle new option parser properly 2019-02-03 20:57:07 -05:00
Vasily
3ac7531385 Merge pull request #802 from jellyfin/fix-build
Fix build error
2019-02-04 00:09:52 +03:00
Bond-009
cb1ff69585 Fix build error 2019-02-03 21:57:49 +01:00
Vasily
a50fb922c5 Merge pull request #774 from dkanada/plugin
reimplement support for plugin repository
2019-02-03 16:42:29 +03:00
Thomas Büttner
593c6c071c keep trailing 0 in version
Signed-off-by: Thomas Büttner <thomas@vergesslicher.tech>
2019-02-03 13:17:31 +01:00
Thomas Büttner
d573f2d671 use cachedir option
Signed-off-by: Thomas Büttner <thomas@vergesslicher.tech>
2019-02-03 13:17:22 +01:00
Thomas Büttner
1ce5939362 optimize rpm dependencies
Signed-off-by: Thomas Büttner <thomas@vergesslicher.tech>
2019-02-03 13:17:11 +01:00
Thomas Büttner
4d335d8f13 Add CentOS
Signed-off-by: Thomas Büttner <thomas@vergesslicher.tech>
2019-02-03 13:15:38 +01:00
dkanada
c118f111b6 add suggestions from code review 2019-02-03 19:40:55 +09:00
dkanada
52e91243e5 merge progress calculation into a single line 2019-02-03 19:40:55 +09:00
dkanada
9faa68b26f update subtitle task to match the other scheduled tasks 2019-02-03 19:40:55 +09:00
dkanada
aadf7676d1 remove useless comments 2019-02-03 19:40:55 +09:00
dkanada
08ca1337a9 unhide several scheduled tasks and add missing properties 2019-02-03 19:40:55 +09:00
dkanada
07072d9f7b move all scheduled tasks and triggers into folders 2019-02-03 19:40:55 +09:00
dkanada
7e3c45c917 fix build errors and update plugin manifest location 2019-02-03 19:40:55 +09:00
dkanada
548270772c add PluginUpdateTask back into source 2019-02-03 19:37:18 +09:00
Bond-009
cb7bffc233 Remove unused string split 2019-02-03 10:44:07 +01:00
Bond-009
da2caa2902 await async functions 2019-02-03 10:44:07 +01:00
Bond-009
ab0e851db9 Cleanup streaming services 2019-02-03 10:44:07 +01:00
Joshua M. Boniface
32f393d57f Merge pull request #764 from Bond-009/encoding
Remove dead code, made some functions properly async
2019-02-02 19:04:10 -05:00
Bond-009
78e4e2ed92 Fix all warnings 2019-02-02 21:45:29 +01:00
Andrew Rabert
42d5a48491 Merge pull request #788 from Bond-009/warnings
Fix more warnings
2019-02-02 14:21:03 -05:00
Andrew Rabert
20dac6d6b8 Merge pull request #794 from Bond-009/lesslinq
Remove MoreLINQ
2019-02-02 14:19:54 -05:00
Bond_009
1cdcace061 Remove dead code 2019-02-02 15:58:39 +01:00
Bond_009
95ee3c72e3 Properly dispose Tasks 2019-02-02 15:56:54 +01:00
Bond_009
66eabcdd39 Minor changes to encoding code
* Don't wait in intervals of 100ms for the file to exist
2019-02-02 15:56:54 +01:00
Sparky
1d94607a30 Fix docker args
After the change to runtime args in #749 docker broke.

This fixes it.
2019-02-02 15:17:59 +01:00
Bond_009
1385d89df6 Remove MoreLINQ 2019-02-02 12:27:06 +01:00
Bond_009
8b073e2ba5 Remove unused field 2019-02-02 12:19:02 +01:00
Joshua M. Boniface
34da7de47d Merge pull request #783 from joshuaboniface/use-cache-flag
Update builds to use #749 and #756
2019-02-01 20:33:22 -05:00
Joshua M. Boniface
021a1887fb Merge pull request #756 from Bond-009/cachedir
Make cache dir configurable
2019-02-01 20:33:00 -05:00
Joshua Boniface
6772ac5603 Fix double-dashes in Fedora environment file 2019-02-01 20:03:04 -05:00
Joshua Boniface
b630e9de82 Allow adm group to view Jellyfin resources
This is pretty arbitrary and personal, but I detest services that
lock out global access (which is good), but don't simultaneously
make it easy for administrators to enter the directories. The adm
group should only have actual system administrators as members,
so this lets them view the secure directories.
2019-02-01 19:16:47 -05:00
Joshua Boniface
7774977cdd Implement review feedback 2019-02-01 19:12:12 -05:00
Bond_009
5ac6d0ae59 Fix more warnings 2019-02-01 21:56:50 +01:00
Bond-009
fa3a8108e5 Update StartupOptions.cs 2019-02-01 19:52:39 +01:00
Bond_009
660f6174b3 Rebase on master 2019-02-01 18:17:43 +01:00
Bond_009
8af1e93cd4 Make cache dir configurable 2019-02-01 18:13:18 +01:00
Bond_009
cabb824f2a Fix build error 2019-02-01 18:11:46 +01:00
Vasily
b4c5ff89fd Merge pull request #782 from hawken93/wat
Remove commented file MediaBrowser.LocalMetadata.Savers.PersonXmlSaver
2019-02-01 14:30:15 +03:00
hawken
78324ff797 Remove commented file MediaBrowser.LocalMetadata.Savers.PersonXmlSaver 2019-02-01 06:51:53 +00:00
minegociomovil
885a000da7 Update iso6392.txt
Add new es-MX option for the latin metadata search in  www.themoviedb.org

Content add: spa||es-mx|Spanish; Latin|espagnol; Latin
2019-02-01 07:38:09 +01:00
Joshua Boniface
aad34e62ca Move jellyfin-sudoers to conf dir 2019-01-31 22:28:12 -05:00
Joshua Boniface
45d8ace9bb Use good ideas from Fedora systemd in Debian 2019-01-31 22:26:31 -05:00
Joshua Boniface
5e4697802f Replace programdata with datadir everywhere 2019-01-31 22:03:55 -05:00
Joshua Boniface
f6227e99cc Add cachedir to deployment scripts; fix bad logdir 2019-01-31 21:57:25 -05:00
Joshua Boniface
ae24d644db Use double-dash args in install-jellyfn.ps1 2019-01-31 21:52:26 -05:00
Joshua Boniface
b982d7c239 Update to long opts and add cache dirs 2019-01-31 21:50:50 -05:00
Joshua M. Boniface
c713824bf9 Merge pull request #734 from Bond-009/culture
Fix more analyzer warnings
2019-01-31 21:11:13 -05:00
Joshua M. Boniface
ea851317e7 Merge pull request #733 from Bond-009/startuptasks
Remove unused function
2019-01-31 20:59:38 -05:00
Claus Vium
8985fb8d58 Remove support for games as a media type 2019-01-31 19:04:47 +01:00
PloughPuff
b5e8cce4cf Improved help text and output errors to stderr
Addressed review comments from JustAMan.
2019-01-31 18:56:34 +01:00
PloughPuff
211ae30188 Revert back to NoAutoRunWebApp
Addressed further review comments.  Removed unnecessary .ParsedStartupOptions namespace.  Removed DataDir, ConfigDir and LogDir from Interface file as not necessary.
2019-01-31 18:56:34 +01:00
PloughPuff
e18b89ca27 Move Options to Jellyfin.Server and create interface file
Changes following review comments.
2019-01-31 18:56:34 +01:00
PloughPuff
ebd2a30087 Accept single-hyphen usage and rename -programdatadir to -datadir
For backwards compatibility, modify the args[] strings to replace single-hyphens with double-hyphens before parsing.

Also rename -programdatadir to -datadir.
2019-01-31 18:56:34 +01:00
PloughPuff
fd361421b1 Use CommandLineParser package for handling CLI args 2019-01-31 18:56:34 +01:00
Claus Vium
f7a46c7a56 Remove more Connect related stuff 2019-01-31 18:47:50 +01:00
Bond-009
2a1f6361a5 Merge branch 'master' into locale 2019-01-31 18:44:36 +01:00
Bond-009
1ea219bf3f Merge branch 'master' into culture 2019-01-30 16:57:15 +01:00
Bond-009
d0f2b3a747 Merge branch 'master' into startuptasks 2019-01-30 16:55:07 +01:00
Vasily
ffcf6bdd3a Merge pull request #713 from EraYaN/fix-emtpy-statement
Fix empty statement in DidlBuilder.cs
2019-01-30 17:17:38 +03:00
Joshua M. Boniface
795f2c8774 Merge pull request #769 from EraYaN/fix-removed-filesystem-wrapper-conditions
Fix conditions where the ! was swallowed in #726
2019-01-29 19:21:30 -05:00
Erwin de Haan
f8aff0c51d Fix conditions where the ! was swallowed in #726 2019-01-30 01:02:17 +01:00
Vasily
055e43eda7 Update Emby.Server.Implementations/Localization/LocalizationManager.cs
Co-Authored-By: Bond-009 <bond.009@outlook.com>
2019-01-29 18:01:55 +01:00
Vasily
c8cb908004 Merge pull request #716 from Bond-009/warnings
Remove more compile time warnings
2019-01-29 19:32:08 +03:00
Vasily
8ab08dd041 Merge pull request #728 from nvllsvm/ffmpeg_docker
Use ffmpeg from jrottenberg/ffmpeg
2019-01-29 17:25:52 +03:00
Vasily
8487319374 Merge pull request #726 from EraYaN/remove-wrappers-for-system-io
Clean up IFileSystem wrappers around stdlib.
2019-01-29 16:50:01 +03:00
Vasily
91e99effc9 Apply suggestions from code review for flipped conditions.
Co-Authored-By: EraYaN <EraYaN@users.noreply.github.com>
2019-01-29 14:45:07 +01:00
Vasily
0e2e731103 Merge pull request #758 from RazeLighter777/master
Add password field to initial setup
2019-01-29 16:11:44 +03:00
Vasily
6822975fd3 Merge pull request #757 from cvium/fix_aspect_ratio_for_real
Fix default aspect ratio
2019-01-29 16:10:51 +03:00
Justin Suess
12e4c1c7ae Added RazeLighter777 to the contributors file 2019-01-28 20:11:46 -06:00
Justin Suess
6786dfcabd Made password field non-mandatory upon setup 2019-01-28 17:37:20 -06:00
Justin Suess
f06b9a14f3 Added password as an API field to the Startup/User Service 2019-01-28 17:25:37 -06:00
Erwin de Haan
838541b825 Removed loose whitespace and one .ToArray() call. 2019-01-28 22:21:14 +01:00
Erwin de Haan
1d1d7e8a37 Fixed inlining local-variable artifact. 2019-01-28 22:10:52 +01:00
Erwin de Haan
d3afa53191 Final refactored IFileSystem and ManagedFileSystem 2019-01-28 22:10:52 +01:00
Erwin de Haan
450f246f95 Unwrapped GetFileNameWithoutExtension 2019-01-28 22:10:51 +01:00
Erwin de Haan
b9a111432a Unwrapped all /(Write|Read)All(Text|Bytes)/ functions. 2019-01-28 22:10:50 +01:00
Erwin de Haan
581a7fe078 Unwrapped MoveDirectory, DirectoryExists, FileExists & removed MoveFile 2019-01-28 22:10:00 +01:00
Erwin de Haan
a430568082 Unwrapped OpenRead and CopyFile 2019-01-28 22:09:58 +01:00
Erwin de Haan
d7c6d16250 Unwrapped CreateDirectory and DeleteDirectory 2019-01-28 22:09:56 +01:00
Erwin de Haan
3a831994f6 Unwrapped GetDirectoryName and DirectorySeperatorChar 2019-01-28 22:06:34 +01:00
Claus Vium
dc68d61491 Fix default aspect ratio 2019-01-28 21:55:44 +01:00
Claus Vium
a05d803d4c Fix crash when trying to deserialize a non-existing scheduled task 2019-01-27 21:09:40 +01:00
Andrew Rabert
b4893b9ac9 Merge pull request #740 from Bond-009/deadcode
Remove code for pre-installed plugins & properly check if file exists
2019-01-27 14:04:39 -05:00
Andrew Rabert
b0608d26b4 Merge pull request #739 from cvium/change_multi_version_movie
Change multi version logic for movies
2019-01-27 12:19:58 -05:00
Andrew Rabert
67b1f9f716 Merge pull request #737 from EraYaN/skia-assembyinfo
Add AssemblyInfo for Jellyfin.Drawing.Skia
2019-01-27 11:52:31 -05:00
Erwin de Haan
39195aae09 Make guidance in issue templates comments, this will declutter issues when people do not remove it. 2019-01-27 17:24:02 +01:00
Erwin de Haan
cc598a86f1 Make guidance in PR template comments, this way we don't get so people just leaving it there. 2019-01-27 17:24:02 +01:00
Bond_009
ffe79c8982 Check if file exists instead of catching exceptions 2019-01-27 17:00:17 +01:00
Claus Vium
05ad2e9b3f Add Year to the new VideoInfo 2019-01-27 16:50:17 +01:00
Claus Vium
42abb5a993 Remove unnecessary ToList 2019-01-27 16:37:12 +01:00
Claus Vium
a4055779f6 Change multi version logic for movies 2019-01-27 16:27:18 +01:00
Bond_009
1a3543e5a5 Remove code for pre-installed plugins 2019-01-27 16:16:37 +01:00
Erwin de Haan
42e0b32c7d Added AssemblyInfo for Jellyfin.Drawing.Skia 2019-01-27 16:08:51 +01:00
Bond_009
85a58fd655 Start startup tasks async 2019-01-27 15:40:37 +01:00
Bond_009
a709cbdc64 Fix more analyzer warnings 2019-01-27 12:12:44 +01:00
Bond_009
08b63a7c11 Remove unused function
RunStartupTasks never executes because "startuptasks.txt" is never
created
2019-01-27 10:55:52 +01:00
Bond_009
51edd5d067 Reworked LocalizationManager to load data async 2019-01-27 10:36:05 +01:00
Luca Beltrame
ee89236fe8 [VA-API] Fix filter order (#714)
ffmpeg is very picky about the filters to be used when using VA-API,
because most of them are incompatible. This is particularly evident when
burning-in subtitles.
2019-01-27 09:44:56 +01:00
Erwin de Haan
fee42e883c Removed unnecessary unsafe keywords. 2019-01-27 09:26:10 +01:00
Andrew Rabert
cc3422b96b Use ffmpeg from jrottenberg/ffmpeg
Eventually would like to move to his 4.0-vaapi image
2019-01-26 21:16:43 -05:00
Andrew Rabert
50279be686 Merge pull request #727 from cvium/change_default_aspect
Change default aspect ratio to 2/3 from 0
2019-01-26 16:23:55 -05:00
Claus Vium
0e617933f6 Change default aspect ratio to 2/3 from 0 2019-01-26 22:19:14 +01:00
Andrew Rabert
f74bfcb343 Merge pull request #724 from Bond-009/skia
Move Skia back into it's own project
2019-01-26 16:03:16 -05:00
Claus Vium
64b6cfa3dc Add Size to TypedBaseItem 2019-01-26 21:59:06 +01:00
Bond_009
bb056f4b59 Cleanup 2019-01-26 21:10:19 +01:00
Bond_009
ce11869a1a Move Skia back into it's own project 2019-01-26 20:43:13 +01:00
Andrew Rabert
e3b19c22a7 Merge pull request #706 from sparky8251/docker-fix
Make another docker layer reusable
2019-01-26 14:23:41 -05:00
Andrew Rabert
05fd76c0fa Merge pull request #723 from Bond-009/dbperf
Minor improvements to db code
2019-01-26 14:21:31 -05:00
Andrew Rabert
7165868509 Merge pull request #709 from Bond-009/null
Fix always null expressions
2019-01-26 14:14:23 -05:00
Andrew Rabert
4190410c7e Merge pull request #710 from Bond-009/spelling
Fix a spelling mistake
2019-01-26 14:13:47 -05:00
Andrew Rabert
b673054c8d Merge pull request #711 from Bond-009/sysevent
Remove remnants of system events
2019-01-26 14:13:25 -05:00
Andrew Rabert
e051ca6ff6 Merge pull request #721 from Bond-009/imagedimensions
Change image dimentions from double to int
2019-01-26 14:12:40 -05:00
Bond_009
d8d6c6f254 Address comments 2019-01-26 19:46:30 +01:00
Bond_009
2ffab720fb Fix ctor 2019-01-26 18:36:38 +01:00
Bond_009
07f163a4c3 Minor improvements to db code 2019-01-26 18:21:41 +01:00
Bond_009
883575893b Change image dimentions from double to int
Rename ImageSize -> ImageDimensions
2019-01-26 13:16:47 +01:00
Erwin de Haan
d1a0497f55 Revert "Merge pull request #452 from Bond-009/activitydb"
This reverts commit 48ad18d12b, reversing
changes made to fe197415ca.
2019-01-25 23:32:06 +01:00
Bond_009
ded9dee22c Remove more compile time warnings 2019-01-25 23:05:01 +01:00
Erwin de Haan
e8f6a61131 Fix empty statement in DidlBuilder.cs 2019-01-25 22:51:34 +01:00
Bond_009
fd7f420af2 Remove remnants of system events 2019-01-25 22:41:43 +01:00
Bond_009
eaa6cb0ddc Fix a spelling mistake 2019-01-25 22:27:33 +01:00
Bond_009
8af256f9c2 Fix always null expressions 2019-01-25 21:52:10 +01:00
Sparky
9f83ee7b3e Make another docker layer reusable
By moving the apt-get layer before the copies, the apt-get layer can be reused with each build, reducing upload/download needed during updates.

Just a small optimization.
2019-01-25 13:27:12 -05:00
Andrew Rabert
e0315b5695 Merge pull request #702 from jellyfin/win-build
Fix debug build on windows
2019-01-25 08:36:21 -05:00
Bond-009
fd36bbede8 Fix debug build on windows 2019-01-25 12:42:45 +01:00
Andrew Rabert
b4fdfb562d Merge pull request #700 from jellyfin/dev
Dev sync
2019-01-24 23:03:54 -05:00
Andrew Rabert
48ad18d12b Merge pull request #452 from Bond-009/activitydb
Use EF Core for Activity database
2019-01-24 23:02:20 -05:00
Andrew Rabert
fe197415ca Merge pull request #657 from Bond-009/true
Remove conditions that are always true/false
2019-01-24 23:02:10 -05:00
Andrew Rabert
0231bd88a7 Merge pull request #672 from cvium/kill_unconditional_caching
Remove unconditional caching, modified since header and use ETags
2019-01-24 23:01:52 -05:00
Andrew Rabert
15806de2aa Merge pull request #681 from LogicalPhallacy/buildscriptfix
Fix Windows build script errors + pin ffmpeg to 4.0
2019-01-24 23:01:20 -05:00
Andrew Rabert
68a7ed6b7c Merge pull request #687 from Bond-009/stylecop
Fix some analyzer warnings
2019-01-24 23:01:07 -05:00
Andrew Rabert
48e1a55d9e Merge pull request #689 from Wuerfelbecher/fix-fedora-build
Fix RPM package build for fedora
2019-01-24 23:00:51 -05:00
Andrew Rabert
2c9e056d52 Merge pull request #699 from jellyfin/dev
Dev sync
2019-01-24 22:57:44 -05:00
Bond_009
8191efb90c Fix some analyzer warnings
Some changes:
* Don't omit braces
* Fix culture sensitive string compare
* Define accessibility functions

I restricted myself to these 5 files, for now :p
2019-01-24 20:14:19 +01:00
Joshua M. Boniface
1d7d4c5738 Merge pull request #686 from Bond-009/analyzers
Disable some StyleCop warnings
2019-01-24 14:07:01 -05:00
hawken
3701ce4037 Eliminate some compile warnings (#600)
* Remove some unused variables
* remove duplicate "using .." by sorting and deduping the list
* Remove things that already exist in the parent class (in one case I moved some documentation to the parent)
* EntityBodyData and and NextSearch were never set (only read), removed
* _timeout was never read, subsequently _timer became unused. part of a TODO timeout functionality that was not implemented yet
2019-01-24 18:56:43 +01:00
Claus Vium
b2ffad9ce9 Set Parent to current query Item if ParentId is empty (#680)
**Changes**
Fixed a faulty change in logic that occurred during the Christmas GPL nightmare.

I stepped through Emby 3.5.2 and stumbled over a difference in the query between Jellyfin and Emby, where in Emby, query.ParentId was set to the item itself. So I did a little digging in the old GPLv2 source and found this https://github.com/MediaBrowser/Emby/blob/3.4.1.8/MediaBrowser.Controller/Entities/Folder.cs#L720

**Issues**
Fixes #673
2019-01-24 18:48:37 +01:00
Vasily
f4015f82e0 Update jellyfin.ruleset
Co-Authored-By: Bond-009 <bond.009@outlook.com>
2019-01-24 18:39:51 +01:00
Phallacy
cab7fa2671 added self to contributors list 2019-01-24 07:36:45 -08:00
Thomas Büttner
6a3ed5d519 Added macOS to the docker sudo exception 2019-01-24 16:24:00 +01:00
Thomas Büttner
f2d0d1f646 Make the docker group check BSD compatible 2019-01-24 15:24:04 +01:00
Phallacy
d6a729c119 parameterized ffmpeg and nssm stuff 2019-01-24 01:56:56 -08:00
Phallacy
4e7675e78f Updated Packaging Windows from Linux for parity 2019-01-24 01:42:34 -08:00
Bond_009
b6f5c33191 Disable SA1633 2019-01-23 23:51:46 +01:00
Bond_009
1cbcddfbd2 Disable SA1309 2019-01-23 23:30:38 +01:00
Bond_009
80d011bb4f Disable SA1200 2019-01-23 23:30:03 +01:00
Bond-009
59ff083f5d Add comment 2019-01-23 23:21:55 +01:00
Thomas Büttner
cc3b1e5cc8 Fix package build for fedora 2019-01-23 21:14:10 +01:00
Bond_009
58591da0b8 Disable warning for calling local function without this. prefixed 2019-01-23 19:17:45 +01:00
Bond_009
905a253ff5 Suffix async methods with Async 2019-01-23 19:09:34 +01:00
Bond_009
3cd31cadf8 No need to check if the dir exists 2019-01-23 18:34:34 +01:00
Bond_009
48da8f429e Return a true IEnumerable 2019-01-23 18:34:34 +01:00
Bond_009
8d9428ebdc Ensure DB exists 2019-01-23 18:34:34 +01:00
Bond_009
f6f0a8a481 Use EF Core for Activity database 2019-01-23 16:39:12 +01:00
Phallacy
a30687a15a Quick fix to erroring build scripts and pulling the supported ffmpeg 2019-01-23 00:41:38 -08:00
LogicalPhallacy
404bd04cbc Merge pull request #8 from jellyfin/master
rebase to latest master
2019-01-23 00:31:35 -08:00
Andrew Rabert
bd550ef996 Fix arm32 Docker 2019-01-22 20:25:41 -05:00
Andrew Rabert
e05e002b8b Merge pull request #677 from nvllsvm/fixdocker
Fix arm32 Docker
2019-01-22 20:11:30 -05:00
Andrew Rabert
ede0439b12 Fix arm32 Docker 2019-01-22 20:04:40 -05:00
Andrew Rabert
becbad981c Merge pull request #535 from Bond-009/streambuilder
Clean up streambuilder
2019-01-22 19:40:59 -05:00
Andrew Rabert
3d01aa1ae4 Merge pull request #656 from hawken93/more_logging
Do some logging in MediaInfoService
2019-01-22 19:38:43 -05:00
Joshua M. Boniface
0fec7994a8 Merge pull request #663 from nvllsvm/tl
Use TagLibSharp Nuget package
2019-01-22 19:35:09 -05:00
Andrew Rabert
090fea21ea Merge pull request #668 from hawken93/prepare_for_reports_module
Return Audio objects from MusicAlbum.Tracks
2019-01-22 19:34:29 -05:00
Andrew Rabert
52dd570142 Merge pull request #671 from Tthecreator/dev
Set EnableRaisingEvents correctly
2019-01-22 19:31:33 -05:00
Andrew Rabert
28483bdb54 Merge pull request #651 from jellyfin/release-10.1.0
Release 10.1.0
2019-01-22 18:13:47 -05:00
Bond_009
722120af74 Remove conditions that are always true/false 2019-01-22 23:49:51 +01:00
Claus Vium
df5e87409a Fix trim input 2019-01-22 22:40:06 +01:00
Claus Vium
94789860b1 Trim quotes from If-None-Match 2019-01-22 22:37:26 +01:00
Claus Vium
fd6d35e1d0 Remove unconditional caching, modified since header and use ETags 2019-01-22 21:18:48 +01:00
Tthecreator
cce90d2b56 removed excess newlines 2019-01-22 19:42:58 +01:00
Joshua Boniface
8106c8393b Update jellyfin-web submodule to 10.1.0 2019-01-22 13:16:42 -05:00
Tthecreator
0b80902cc8 Set EnableRaisingEvents correctly for SubtitleEncoder 2019-01-22 16:52:26 +01:00
Tthecreator
189b99df16 Merge pull request #1 from jellyfin/dev
Update from jellyfin repo
2019-01-22 15:22:42 +00:00
hawken
490e22c790 Add comments to SqliteItemRepository to help out whoever is next 2019-01-22 12:20:36 +00:00
hawken
a356c1417a Change MusicAlbum.Tracks to return Audio items 2019-01-22 12:19:50 +00:00
hawken
07cba6cbcf Do some logging in MediaInfoService 2019-01-22 10:24:00 +00:00
Joshua Boniface
411139cd78 Update changelogs to add #666 2019-01-21 23:56:02 -05:00
Anthony Lavado
29f3330091 Merge pull request #666 from nvllsvm/cross-platform
Add cross-platform build for arm64
2019-01-21 23:55:17 -05:00
Andrew Rabert
8108e295dc Add Dockerfile.arm64 docs 2019-01-21 23:43:13 -05:00
Andrew Rabert
aa25dd1a0b Update to .NETCore 3.0 2019-01-21 23:17:56 -05:00
Andrew Rabert
23c52c3fb9 Disable cross-platform build for arm32v7
https://github.com/jellyfin/jellyfin/issues/665
2019-01-21 23:17:30 -05:00
Andrew Rabert
a5aa482b6c Update arm/arm64 images to build cross-platform
These Dockerfiles can not be built natively - must be built on x86_64
2019-01-21 22:47:51 -05:00
Joshua Boniface
8d298e0e36 Update changelogs to remove #639, add #661, #54 2019-01-21 21:24:28 -05:00
Andrew Rabert
13f1ea2c19 Merge pull request #664 from jellyfin/revert-639-ffmpeg4.1
Revert "Fix segment_time_delta for ffmpeg 4.1"
2019-01-21 20:21:36 -05:00
Andrew Rabert
9ad182502f Merge pull request #661 from Bond-009/streamstate
Fix NullRef from progress report
2019-01-21 20:05:43 -05:00
Joshua M. Boniface
b2767eceff Revert "Fix segment_time_delta for ffmpeg 4.1" 2019-01-21 19:29:47 -05:00
Andrew Rabert
bc8a0eeead Use TagLibSharp Nuget package 2019-01-21 19:22:08 -05:00
Bond_009
73df5bdbe9 Fix NullRef 2019-01-21 23:50:47 +01:00
Joshua Boniface
e6b95db132 Add jellyfin-web#53 to changelogs 2019-01-21 16:34:53 -05:00
Joshua Boniface
e30cf63aef Add helpful time text around platform builds 2019-01-21 16:34:53 -05:00
Joshua M. Boniface
571afa4fe2 Merge pull request #655 from joshuaboniface/local-web-branch
Support trying local branches in submodule
2019-01-21 13:28:40 -05:00
Joshua Boniface
42f2799d66 Add jellyfin-web#52 to changelogs 2019-01-21 13:25:26 -05:00
Joshua Boniface
384f867228 Update changelogs to include this PR 2019-01-21 12:57:46 -05:00
Joshua Boniface
cf85e2327e Support trying local branches in submodule 2019-01-21 12:48:27 -05:00
Bond_009
2f8f9e6853 Address comments 2019-01-21 16:57:10 +01:00
Bond_009
06d9423f00 Clean up last bits 2019-01-21 16:48:45 +01:00
Bond_009
37be6c87eb Make ConditionProcessor static 2019-01-21 16:48:45 +01:00
Bond_009
c9b88ab741 Clean up streambuilder 2019-01-21 16:48:45 +01:00
Joshua Boniface
0dab69b551 Use basename for cross-platform operation
Trying to sed out the deployment/ failed on MacOS, so use the
basename command instead for the same effect.
2019-01-21 01:42:25 -05:00
Joshua Boniface
ff4cbfc6df Fix inconsistencies in changelogs 2019-01-21 00:02:56 -05:00
Joshua Boniface
c72144111e Correct bad signature line 2019-01-21 00:02:56 -05:00
Joshua M. Boniface
3518400b22 Merge branch 'master' into release-10.1.0 2019-01-20 23:48:23 -05:00
Joshua Boniface
adf037c44c Complete and remove todo from bump_version 2019-01-20 23:41:37 -05:00
Joshua Boniface
73038ee3f7 Bump version to 10.1.0 2019-01-20 23:39:55 -05:00
Andrew Rabert
920c39454c Merge pull request #646 from Tthecreator/master
Fix infinite loop bug on subtitle.m3u8 request
2019-01-20 21:16:28 -05:00
Andrew Rabert
edcfd8b565 Merge pull request #631 from Bond-009/imagesize
Cleanup ImageProcessor and SkiaEncoder
2019-01-20 20:49:51 -05:00
Andrew Rabert
7327bb91a3 Fix func name 2019-01-20 20:48:24 -05:00
Andrew Rabert
6a5488c651 Formatting 2019-01-20 20:47:02 -05:00
Andrew Rabert
1cf1e9bfa1 Update appPaths position 2019-01-20 20:46:40 -05:00
Andrew Rabert
7469ed4e6e Update logger position 2019-01-20 20:46:00 -05:00
Andrew Rabert
c7f648f86a Merge branch 'dev' into imagesize 2019-01-20 20:45:06 -05:00
Tthecreator
3069c749b4 Added myself to contributers 2019-01-21 00:40:59 +01:00
Tthecreator
d02642bf7b Fixed bug where the server would eat up ram with subtitles request 2019-01-21 00:38:01 +01:00
Andrew Rabert
803bf563d7 Merge pull request #621 from Bond-009/perf
Minor improvements to library scan code
2019-01-20 18:13:49 -05:00
Andrew Rabert
d16f38dbe1 Merge pull request #623 from wtayl0r/inject-logger-factories
Replaced injections of ILogger with ILoggerFactory
2019-01-20 18:12:50 -05:00
Andrew Rabert
e8813ced3c Merge pull request #638 from EraYaN/clean-test-files
Removed XmlTv testfiles and nuget install
2019-01-20 18:12:10 -05:00
Andrew Rabert
a1fcf4ea0d Merge pull request #613 from MatMaul/mediaencoding-dev
Update MediaEncoding
2019-01-20 18:11:51 -05:00
Andrew Rabert
c8dd72886b Merge pull request #636 from cvium/fix_subtitle_conversion_direct_streaming
Allow subtitle extraction and conversion in direct streaming
2019-01-20 16:59:16 -05:00
Andrew Rabert
c64cc733d2 Merge pull request #639 from Bond-009/ffmpeg4.1
Fix segment_time_delta for ffmpeg 4.1
2019-01-20 16:55:45 -05:00
William Taylor
190bc46c1b Removed unused parameters from Program.getImageEncoder 2019-01-20 21:54:07 +00:00
Mathieu Velten
ae73f7b3e3 Fix transcoding bitrate 2019-01-20 22:50:17 +01:00
Mathieu Velten
060eb98cc5 Fix encoding profile handling for vaapi 2019-01-20 22:50:17 +01:00
Mathieu Velten
da16de48aa Revert back to 10e57ce8d21b4516733894075001819f3cd6db6b for MediaEncoding
Remove some duplicate code that were causing warnings
2019-01-20 22:50:09 +01:00
William Taylor
e62198650e Updated param name 2019-01-20 21:05:12 +00:00
William Taylor
88f13492c7 Added myself to contributors.md 2019-01-20 21:05:12 +00:00
William Taylor
65cd3ed597 Replaced injections of ILogger with ILoggerFactory
This makes resolving dependencies from the container much easier as
you cannot resolve with primitives parameters in a way that is any
more readable.

The aim of this commit is to change as little as possible with the end
result, loggers that were newed up for the parent object were given the same
name. Objects that used the base or app loggers, were given a new logger with
an appropriate name.

Also removed some unused dependencies.
2019-01-20 21:05:12 +00:00
Bond_009
c27aff1c63 Fix segment_time_delta for ffmpeg 4.1 2019-01-20 21:56:50 +01:00
Vasily
0586598d33 Merge pull request #637 from Bond-009/font
Remove unused font
2019-01-20 23:16:42 +03:00
Claus Vium
e8cf72e925 Change CanExtractSubtitles to true to allow conversion during direct streaming 2019-01-20 21:03:18 +01:00
Bond_009
fc7c211025 Remove unused font 2019-01-20 20:32:15 +01:00
Anthony Lavado
3d441d4a73 Merge pull request #634 from joshuaboniface/replace-tvdbkey
Replace our TVDB key with @drakus72's which is V1
2019-01-20 13:48:18 -05:00
Bond_009
35d97dc949 Minor improvements to library scan code 2019-01-20 19:40:37 +01:00
Joshua M. Boniface
18189644e3 Merge pull request #622 from joshuaboniface/unified-build
Add unified build script and bump_version script
2019-01-20 13:28:39 -05:00
Joshua Boniface
56365e9237 Bail out if web branch is unclean like build does 2019-01-20 13:19:50 -05:00
Joshua Boniface
9da5d3acc2 Replace our TVDB key with @drakus72's which is V1 2019-01-20 12:59:22 -05:00
Joshua Boniface
3320d4feeb Move dotnet to a per-platform dependency 2019-01-20 12:34:52 -05:00
Joshua Boniface
90b9a95619 Use LANG=C for date in Yum changelog 2019-01-20 12:23:36 -05:00
Andrew Rabert
3a6624f701 Merge pull request #629 from cvium/fix_subtitleencoder
Fix subtitle converter misinterpreting 0 valued endTimeTicks
2019-01-20 11:35:20 -05:00
Claus Vium
2b47006662 Remove unneeded variable 2019-01-20 17:06:40 +01:00
Andrew Rabert
acb9afd908 Merge pull request #598 from cvium/remove_textencoding
Remove MediaBrowser.Text for license violations and hackiness
2019-01-20 10:33:59 -05:00
Bond_009
7e4cc9f513 Touchup 2019-01-20 14:39:05 +01:00
Bond_009
ca910325f3 Remove unneeded fields 2019-01-20 14:25:13 +01:00
Bond_009
8fc8fc0622 Cleanup ImageProcessor 2019-01-20 14:18:37 +01:00
Claus Vium
2dc14aa85d Remove CodePages from csproj 2019-01-20 11:41:33 +01:00
Claus Vium
26e20d1cd5 Fix subtitle converter misinterpreting 0 valued endTimeTicks 2019-01-20 08:17:31 +01:00
Claus Vium
217d35ee74 Fix missing imports after rebase 2019-01-20 06:33:33 +01:00
cvium
790266d314 Add package ref for codepages 2019-01-20 06:30:52 +01:00
cvium
eba1f05c03 Remove embedded resource from csproj 2019-01-20 06:30:52 +01:00
cvium
b35dcbb9f0 Remove MediaBrowser.Text since it violates licenses and is overall hacky 2019-01-20 06:30:50 +01:00
Joshua M. Boniface
3a5e3ade01 Merge pull request #628 from nvllsvm/name
Update Product Name (User-Agent)
2019-01-20 00:01:02 -05:00
Andrew Rabert
fbc82c88be Update product name to Jellyfin Server 2019-01-19 23:53:23 -05:00
Andrew Rabert
9eada88545 Use AssmeblyProduct for Name 2019-01-19 23:52:40 -05:00
Andrew Rabert
6561021926 Merge pull request #582 from nvllsvm/image
Replace custom image parser with Skia
2019-01-19 22:42:46 -05:00
Andrew Rabert
d72d0fb865 Merge pull request #627 from nvllsvm/version
Use string for ApplicationVersion
2019-01-19 22:39:20 -05:00
Andrew Rabert
875392c77f Combine Emby.Drawing and Emby.Drawing.Skia 2019-01-19 22:38:41 -05:00
Andrew Rabert
449dd1a6a2 Remove allowSlowMethods from image processing 2019-01-19 22:33:55 -05:00
Andrew Rabert
9a7a5ef50e Replace custom image parser with Skia 2019-01-19 22:30:16 -05:00
Joshua Boniface
bc18d5341c Make help and usage setup standards-compliant 2019-01-19 22:05:41 -05:00
Joshua Boniface
99dfb8549f Use the same branch for web by default 2019-01-19 21:57:29 -05:00
Joshua Boniface
4f14b479bb Bashify all variable references 2019-01-19 21:56:00 -05:00
Andrew Rabert
f229c641a1 Remove redundant GetDefaultUserAgent 2019-01-19 21:48:38 -05:00
Andrew Rabert
235125df57 Fix ApplicationUserAgent documentation 2019-01-19 21:41:48 -05:00
Andrew Rabert
d7da475aad Fix User-Agent 2019-01-19 21:38:42 -05:00
Andrew Rabert
8de4eb7d19 Rename ApplicationSemanticVersion to ApplicationVersion 2019-01-19 21:35:33 -05:00
Andrew Rabert
8a5198e6a3 Remove ApplicationVersion 2019-01-19 21:34:47 -05:00
Joshua Boniface
85966b54fb Small formatting consistency tweak 2019-01-19 21:19:42 -05:00
Andrew Rabert
469590c9c5 Merge pull request #508 from EraYaN/api-version-reporting
Update internal versioning and user agents.
2019-01-19 21:08:35 -05:00
Erwin de Haan
e066a02403 Removed useless method, Name => Jellyfin Server 2019-01-20 01:20:58 +01:00
Erwin de Haan
924ec0c191 Revert Jellyfin.Versioning, Update all versions and user agents. 2019-01-20 01:12:44 +01:00
Joshua Boniface
daaa007fea Update YUM spec version 2019-01-19 18:57:14 -05:00
Joshua Boniface
0addc9ef46 Add mention of dependencies file per platform 2019-01-19 18:48:48 -05:00
Joshua Boniface
9f8b716f40 Add dependencies.txt entries for Docker builds 2019-01-19 18:45:29 -05:00
Joshua Boniface
edfd950aad Add bump_version script 2019-01-19 18:37:05 -05:00
Erwin de Haan
bb8df8dfa0 Updates reported version in System/Info* set of endpoints.
Added ProductName and ServerVersion to API.

Added build version and build step. Addressed issues wtih indentation.

Made the BuildVersion an actual object. This lets up link to the github page of that commit.

Fixed class method type and styled link.

Fixed languages and split out the information in the UI.

Moved update-version script and gave it executable permissions. Windows correctly finds the .bat file. And linux takes the one without extension.

Removed tempfiles from replace sessions from csproj.

Updated version generation scripts. Will also work with pre existing version files. (Source tarballs etc.)

Added simple replace for ssh github links.

Add execute rights to update-version.

Wrapped long line in ApplicationHost.cs

Fixed some small issues.

Fixed some small issues, and flipped some if's around.

Converted parameter names to camelBack casing.

Sealed the attribute class.

Removed MPLv2 license.

Fixed file headers.

Added newline.

Moved links in *.csproj files as well.

Fix issues caused by rebase auto merging.

Removed default constructor and added init values to properties, also hid the Remote value form API.
2019-01-20 00:28:48 +01:00
Joshua Boniface
f952988fb3 Add new centralized build script and README 2019-01-19 18:10:54 -05:00
Vasily
97639e5c85 Merge pull request #534 from EraYaN/skia-native-arm
Add linux-arm and linux-arm64 native NuGet dependency.
2019-01-20 01:44:35 +03:00
Joshua Boniface
d42ef36bf9 Correct invalid changelog entry 2019-01-19 16:44:55 -05:00
Joshua M. Boniface
1bd477e2e5 Merge pull request #626 from EraYaN/m3uparser-syntax-fix
Fix extra type name in parameter, add out keyword
2019-01-19 16:11:27 -05:00
Erwin de Haan
949393043d Fixed missing out keyword. 2019-01-19 22:07:48 +01:00
Andrew Rabert
55538764fa Merge pull request #575 from EraYaN/reformat
Reformat all C# server code to conform with code standards
2019-01-19 15:11:50 -05:00
Andrew Rabert
3b52035ee0 Merge pull request #616 from nvllsvm/swagger
Add Swagger documentation
2019-01-19 15:09:20 -05:00
Erwin de Haan
c5430f86b0 Fixed csproj and xml identation. 2019-01-19 15:01:16 +01:00
Erwin de Haan
1e94023927 Merge branch 'dev' into reformat 2019-01-19 14:45:02 +01:00
Vasily
a00c0defa8 Merge pull request #596 from Bond-009/editorconfig
Fix indentation for xml files
2019-01-19 16:35:38 +03:00
Erwin de Haan
e63b18f17d Reformat JustAMan review second pass changes. 2019-01-19 14:30:23 +01:00
Andrew Rabert
72ab479d1f Merge pull request #619 from sparky8251/really-slimdown-docker-image
Really slim down Docker container
2019-01-18 21:49:23 -05:00
Joshua M. Boniface
bf7d8fdf4a Merge pull request #589 from ploughpuff/patch-1
Ensure config and log folders exist
2019-01-18 14:32:09 -05:00
PloughPuff
582226c133 Cause exception if empty string used for config or log folders 2019-01-18 18:11:42 +00:00
PloughPuff
529d804414 Modify to use correct logic before creating directory
Address review comments.
2019-01-18 17:22:14 +00:00
Erwin de Haan
d116efe1f7 Merge branch 'dev' into reformat 2019-01-18 17:04:01 +01:00
Erwin de Haan
c1f76eb8ab Reformat JustAMan review pt3 changes 2019-01-18 16:48:01 +01:00
Sparky
d00e43735f Really slim down Docker container
#606 didn't actually run the new commands due to the comments position.

This fixes the comment location.
2019-01-18 10:26:02 -05:00
PloughPuff
04d03c5cf9 Ensure all folders are created before running app 2019-01-18 10:10:45 +00:00
Andrew Rabert
e9e152d2fc Adapt SwaggerService for Jellyfin 2019-01-18 00:55:33 -05:00
Andrew Rabert
cfd5d1a4f2 Restore SwaggerService from 7aa573d4e0fc231932ad3da4cdf15199cf97709a 2019-01-18 00:40:33 -05:00
Andrew Rabert
440350a3f6 Merge pull request #606 from sparky8251/docker-update
Slim down docker image
2019-01-17 20:54:08 -05:00
Sparky
fe4c3fddb4 Slim down docker image
After installing, remove package caches and clean up after installation of stuff.
2019-01-17 18:59:52 -05:00
Erwin de Haan
38f96af079 Reformat JustAMan review pt2 changes
Refs #575
2019-01-17 20:24:39 +01:00
Erwin de Haan
321c440739 Reformat JustAMan review pt1 changes
Refs #575
2019-01-17 20:24:01 +01:00
Erwin de Haan
e241589969 Merge branch 'dev' into skia-native-arm 2019-01-17 17:48:01 +01:00
Erwin de Haan
47f08fbb12 Remove Musl build. dotnet is not yet ready (icu-libs still require libstdc++). 2019-01-17 17:45:34 +01:00
Erwin de Haan
a0195420df Added Musl dep and switched package names. 2019-01-16 23:30:29 +01:00
Joshua M. Boniface
7aa975325a Merge pull request #455 from Bond-009/cleanup
Cleanup some small things
2019-01-16 13:17:39 -05:00
Bond-009
d0980f0da5 Update HttpListenerHost.cs 2019-01-16 19:13:13 +01:00
Bond-009
900dc851e6 Merge branch 'dev' into cleanup 2019-01-16 19:10:42 +01:00
Joshua M. Boniface
933ef43889 Merge pull request #587 from Bond-009/naming
Add nuget info to Emby.Naming
2019-01-16 11:52:24 -05:00
Joshua M. Boniface
2b1e3aa45f Merge pull request #567 from Bond-009/term
Shutdown gracefully when recieving a termination signal
2019-01-16 11:49:53 -05:00
Bond_009
67465c6e10 Fix indentation for xml files 2019-01-16 16:30:01 +01:00
Joshua M. Boniface
5b1f36ef27 Merge pull request #520 from hawken93/fix_aspect
Fix potential bug where aspect ratio would be incorrectly calculated
2019-01-15 22:37:01 -05:00
Joshua Boniface
b30d702782 Merge branch 'master' into dev 2019-01-15 22:29:22 -05:00
hawken
bddfca6215 Fix potential problem where aspect ratio would be incorrectly calculated 2019-01-15 20:10:26 +00:00
Erwin de Haan
a358631040 Extra formatting on the merged code. 2019-01-15 17:35:33 +01:00
Erwin de Haan
49b61f238e Merge branch 'dev' into reformat
# Conflicts:
#	Emby.Server.Implementations/ApplicationHost.cs
#	Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
#	Emby.Server.Implementations/LiveTv/LiveTvManager.cs
#	Emby.Server.Implementations/Security/MBLicenseFile.cs
#	Emby.Server.Implementations/Security/PluginSecurityManager.cs
#	Emby.Server.Implementations/Security/RegRecord.cs
#	MediaBrowser.Api/PluginService.cs
#	MediaBrowser.Api/System/SystemService.cs
#	MediaBrowser.Common/Security/IRequiresRegistration.cs
#	MediaBrowser.Common/Security/ISecurityManager.cs
#	MediaBrowser.Common/Security/PaymentRequiredException.cs
#	MediaBrowser.Model/Entities/MBRegistrationRecord.cs
#	MediaBrowser.Model/Entities/PluginSecurityInfo.cs
#	deployment/win-generic/build-jellyfin.ps1
2019-01-15 17:34:39 +01:00
Claus Vium
99acf83dfa Add cvium to CONTRIBUTORS 2019-01-15 16:48:21 +01:00
cvium
e5ffa45dbe more descriptive TODO 2019-01-15 16:48:21 +01:00
cvium
22a64f37f5 More cleaning 2019-01-15 16:48:21 +01:00
cvium
0e422a33d6 Some code style clean up 2019-01-15 16:48:21 +01:00
Claus Vium
256e6dc195 removed more dead code 2019-01-15 16:48:21 +01:00
Claus Vium
e0e5a487c3 removed commented code 2019-01-15 16:48:21 +01:00
Claus Vium
801726ce38 readded some registration endpoints 2019-01-15 16:48:21 +01:00
hawken
19319e8eb6 Remove MBLicenseFile 2019-01-15 16:48:21 +01:00
Claus Vium
d707e969fa Added some todos 2019-01-15 16:48:21 +01:00
Claus Vium
4a03ac4022 mock the registration endpoint since livetv etc. still uses it 2019-01-15 16:48:21 +01:00
Claus Vium
eca3c099d9 removed a bunch of validation, security, registration, premiere, whatever bs 2019-01-15 16:48:21 +01:00
Andrew Rabert
8ea0c72070 Merge pull request #335 from EraYaN/build-system-consolidation
Build scripts and build system consolidation.
2019-01-14 20:06:28 -05:00
Bond-009
351bac44c5 Add nuget info to Emby.Naming 2019-01-14 22:02:51 +01:00
Erwin de Haan
9c4239af01 Updated MediaBrowser.Tests AssemblyInfo.cs 2019-01-14 08:32:31 +01:00
Erwin de Haan
9b224d7080 Merged the two ARM platforms. To be split apart when a binary ffmpeg is required. 2019-01-13 23:43:12 +01:00
Erwin de Haan
ca320ba7ac Sudo fix for debian and fedora. 2019-01-13 23:34:40 +01:00
Erwin de Haan
ae0732136f Merge remote-tracking branch 'upstream/dev' into build-system-consolidation 2019-01-13 23:28:05 +01:00
Erwin de Haan
d7b7be395b Moved ARM dockerfiles back to root. 2019-01-13 23:24:43 +01:00
Erwin de Haan
9d0a08571e Merge branch 'dev' into reformat 2019-01-13 21:59:37 +01:00
Joshua M. Boniface
f8dd182e42 Merge pull request #562 from hawken93/misc_fix
Fix error with uppercase photo extension and fix typo in a log line
2019-01-13 15:49:05 -05:00
Erwin de Haan
23f5c1d90b ReSharper format: 'out' parameter inlining 2019-01-13 21:48:18 +01:00
Erwin de Haan
e867446437 ReSharper format: conform inline 'out' parameters. 2019-01-13 21:46:33 +01:00
Andrew Rabert
f50a997e40 Merge pull request #580 from nvllsvm/fixbuild
Fix Docker build
2019-01-13 20:39:42 +00:00
Andrew Rabert
006e81588a Merge pull request #576 from Bond-009/analysers
Add code analysers for debug builds
2019-01-13 20:38:08 +00:00
Erwin de Haan
65bd052f3e ReSharper conform to 'var' settings 2019-01-13 21:37:13 +01:00
Andrew Rabert
17c60f46db Fix build 2019-01-13 15:35:15 -05:00
Erwin de Haan
a36658f6f0 ReSharper Reformat: Properties to expression bodied form. 2019-01-13 21:31:14 +01:00
Andrew Rabert
f11a4368bb Reformat args 2019-01-13 15:30:30 -05:00
Erwin de Haan
9fa60ec934 Find+Sed BOM removal all toher files, except test files. 2019-01-13 21:20:44 +01:00
Erwin de Haan
089ad8e7c2 Find+Sed BOM removal *.xml,*.csproj,*,json,*.sln,*.txt 2019-01-13 21:10:15 +01:00
Erwin de Haan
b062577d81 Find+Sed BOM removal *.cs: MediaBrowser.Providers-SocketHttpListener 2019-01-13 21:03:10 +01:00
Erwin de Haan
8f41ba4d3a Find+Sed BOM removal *.cs: MediaBrowser.LocalMetadata-MediaBrowser.Model 2019-01-13 21:02:23 +01:00
Erwin de Haan
ba610b5094 Find+Sed BOM removal *.cs: Jellyfin.Server-MediaBrowser.Controller 2019-01-13 21:01:16 +01:00
Erwin de Haan
e566d9a231 Find+Sed BOM removal *.cs: BDInfo-Emby.XmlTv 2019-01-13 20:54:44 +01:00
Erwin de Haan
742bef5b5f EditorConfig reformat: Non-CS files. 2019-01-13 20:45:51 +01:00
Erwin de Haan
aacafee1de EditorConfig reformat: MediaBrowser.Providers, MediaBrowser.Tests, SocketHttpListener 2019-01-13 20:31:48 +01:00
Erwin de Haan
382e8699a2 EditorConfig reformat: MediaBrowser.Model 2019-01-13 20:31:15 +01:00
Erwin de Haan
3ed6f37030 EditorConfig reformat: MediaBrowser.Controller 2019-01-13 20:30:58 +01:00
Erwin de Haan
51ed47f4c4 EditorConfig reformat: Emby.XmlTv, Jellyfin.Server. MediaBrowser.Api, MediaBrowser.Common 2019-01-13 20:30:41 +01:00
Erwin de Haan
5b3d8a6d76 EditorConfig reformat: Emby.IsoMounting, Emby.Server.Implementations 2019-01-13 20:30:03 +01:00
Erwin de Haan
cc719fd77c EditorConfig reformat: BDInfo, DvdLib, Emby.Dlna 2019-01-13 20:29:23 +01:00
Erwin de Haan
8fd0bc63b9 Visual Studio Reformat: SocketHttpListener 2019-01-13 20:27:29 +01:00
Erwin de Haan
9014e16037 Visual Studio Reformat: OpenSubtitlesHandler 2019-01-13 20:27:11 +01:00
Erwin de Haan
9741817af4 Visual Studio Reformat: MediaBrowser.XbmcMetadata 2019-01-13 20:26:56 +01:00
Erwin de Haan
f4ae36b2a8 Visual Studio Reformat: MediaBrowser.WebDashboard 2019-01-13 20:26:44 +01:00
Erwin de Haan
587bb85b41 Visual Studio Reformat: MediaBrowser.Providers 2019-01-13 20:26:31 +01:00
Erwin de Haan
1a4b271314 Visual Studio Reformat: MediaBrowser.Model 2019-01-13 20:26:15 +01:00
Erwin de Haan
f2e50f50bd Visual Studio Reformat: MediaBrowser.MediaEncoding 2019-01-13 20:26:04 +01:00
Erwin de Haan
22879a603e Visual Studio Reformat: MediaBrowser.LocalMetadata 2019-01-13 20:25:45 +01:00
Erwin de Haan
26ca4b607b Visual Studio Reformat: MediaBrowser.Controller 2019-01-13 20:25:32 +01:00
Erwin de Haan
106d1d18ed Visual Studio Reformat: MediaBrowser.Common 2019-01-13 20:25:11 +01:00
Erwin de Haan
b67c1b933e Visual Studio Reformat: MediaBrowser.Api 2019-01-13 20:24:58 +01:00
Erwin de Haan
f0acc0446c Visual Studio Reformat: Jellyfin.Server 2019-01-13 20:24:27 +01:00
Erwin de Haan
80691e53b0 Visual Studio Reformat: Emby.XmlTv 2019-01-13 20:24:14 +01:00
Erwin de Haan
d655283ef0 Visual Studio Reformat: Emby.Server.Implementations Part U-U & Root 2019-01-13 20:23:38 +01:00
Erwin de Haan
25f0315e91 Visual Studio Reformat: Emby.Server.Implementations Part T-T 2019-01-13 20:22:56 +01:00
Erwin de Haan
0efc699e3d Visual Studio Reformat: Emby.Server.Implementations Part S-S 2019-01-13 20:22:24 +01:00
Erwin de Haan
39ef1106d7 Visual Studio Reformat: Emby.Server.Implementations Part Liv-P 2019-01-13 20:22:00 +01:00
Erwin de Haan
58b582bdcb Visual Studio Reformat: Emby.Server.Implementations Part I-Lib 2019-01-13 20:21:32 +01:00
Erwin de Haan
c5c7a3c4ee Visual Studio Reformat: Emby.Server.Implementations Part De-H 2019-01-13 20:20:41 +01:00
Erwin de Haan
a5288115a8 Visual Studio Reformat: Emby.Server.Implementations Part A-Da 2019-01-13 20:20:16 +01:00
Erwin de Haan
dd15c808cb Visual Studio Reformat: Emby.Photos 2019-01-13 20:18:28 +01:00
Erwin de Haan
decc475f7c Visual Studio Reformat: Emby.Notifications 2019-01-13 20:18:07 +01:00
Erwin de Haan
5665933849 Visual Studio Reformat: Emby.Naming 2019-01-13 20:17:29 +01:00
Erwin de Haan
25a428373c Visual Studio Reformat: Emby.IsoMounting 2019-01-13 20:17:15 +01:00
Erwin de Haan
009c95d972 Visual Studio Reformat: Emby.Drawing 2019-01-13 20:17:02 +01:00
Erwin de Haan
9d37fd96f1 Visual Studio Reformat: Emby.Drawing.Skia 2019-01-13 20:16:43 +01:00
Erwin de Haan
8bfb54a41b Visual Studio Reformat: Emby.Dlna 2019-01-13 20:16:19 +01:00
Erwin de Haan
17703c8bd2 Visual Studio Reformat: DvdLib 2019-01-13 20:15:33 +01:00
Erwin de Haan
1077570ca8 Visual Studio Reformat: BDInfo 2019-01-13 20:15:15 +01:00
Andrew Rabert
e8d93b3485 Merge pull request #566 from Bond-009/dlna
Avoid printing stacktrace when bind to port 1900 fails
2019-01-13 19:02:40 +00:00
Bond_009
56de8c893a Add code analysers for debug builds 2019-01-13 19:16:22 +01:00
Joshua M. Boniface
9dcaafe700 Merge pull request #458 from EraYaN/code-cleanup
Clean up several minor issues and add TODOs
2019-01-13 12:14:53 -05:00
Anthony Lavado
17d8de4962 Merge pull request #571 from Bond-009/nuget
Add more NuGet metadata properties
2019-01-13 11:37:49 -05:00
Erwin de Haan
b936c43932 Pull in change from build system, to fix the drone build once and for all. 2019-01-13 16:32:54 +01:00
hawken
c8e3c1737a Fix small logging typo with the "name (path) will be refreshed" message 2019-01-13 11:59:24 +00:00
hawken
f2dae8ee51 Make image header extension matching case insensitive 2019-01-13 11:59:24 +00:00
Bond_009
3a2a0fbfe8 Add more NuGet metadata properties
Remove old nuspec files
2019-01-13 11:57:33 +01:00
Bond-009
81475e361b Add exception message to log.
Output will be something line: `Failed to bind to port 1900: Address already in use. DLNA will be unavailable`
2019-01-13 01:31:55 +01:00
Bond_009
50c127fd9a Add proper exit codes 2019-01-13 01:05:25 +01:00
Bond_009
bf4de012da Catch exception instead of masking it 2019-01-13 00:55:37 +01:00
Bond_009
debb8e56fd Handle Ctrl+C and Ctrl+Break 2019-01-13 00:49:11 +01:00
Erwin de Haan
ddc18a1ca7 Updated package. 2019-01-13 00:28:40 +01:00
Bond_009
0abdfbb526 Shutdown gracefully when recieving a termination signal 2019-01-12 23:31:45 +01:00
Erwin de Haan
e9519de07d Fixed removed start tag of XMLComment. 2019-01-12 22:54:47 +01:00
Bond_009
783e74d9c9 Don't print stacktrace when failing to bind to 1900 2019-01-12 22:25:55 +01:00
Joshua M. Boniface
78a5d999f4 Delete CODEOWNERS from dev branch
This was removed from master but wasn't transitioned with that merge because of GitHub being annoying and treating CODEOWNERS differently in each branch.
2019-01-12 16:10:51 -05:00
Erwin de Haan
846456b41e Reformatted the files with notes. 2019-01-12 21:41:08 +01:00
Joshua M. Boniface
41343b9220 Merge pull request #563 from jellyfin/master
Update dev from master
2019-01-12 15:23:48 -05:00
Joshua M. Boniface
016bad1ea3 Merge pull request #556 from grafixeyehero/dev
Fix "Password Reset by PIN" page
2019-01-12 13:44:09 -05:00
Joshua Boniface
e04f652eff Add Master codeowners
In conjunction with branch protection rules, this will require
approval from the Org owners (myself or @nvllsvm) before a merge
can be accepted.
2019-01-12 13:41:37 -05:00
Joshua M. Boniface
03ec62e478 Add link to our contributing docs as well 2019-01-12 13:41:37 -05:00
Vasily
dadd6e11b1 Add link to writing good messages article
Co-Authored-By: joshuaboniface <joshua@boniface.me>
2019-01-12 13:41:37 -05:00
Vasily
c28283aa7c Be explcit about what the version is
Co-Authored-By: joshuaboniface <joshua@boniface.me>
2019-01-12 13:41:37 -05:00
Joshua M. Boniface
2e53f4c2e9 Add blurb about title 2019-01-12 13:41:37 -05:00
Joshua M. Boniface
f1d6f04572 Consistent formatting for System fields 2019-01-12 13:41:37 -05:00
Joshua M. Boniface
f818053a43 Update bug_report.md
Add section about log files.
2019-01-12 13:41:37 -05:00
Joshua Boniface
874a6bf38b Update pull request template 2019-01-12 13:41:37 -05:00
Joshua M. Boniface
deb9d97d37 Update issue templates
Adds issue templates for Bugs, Features, and Enhancements.
2019-01-12 13:41:37 -05:00
Erwin de Haan
672013c23d Add TODO for netcore version upgrade. 2019-01-12 16:34:13 +01:00
Erwin de Haan
b73d081bd2 Updated docker build script. 2019-01-12 15:56:06 +01:00
Erwin de Haan
ba671569b4 Moved main docker file. 2019-01-12 15:54:52 +01:00
Erwin de Haan
2c65fe53f2 Enabled update-version in anticipation of the versioning PR. 2019-01-12 03:09:38 +01:00
Erwin de Haan
2c62f8dbd5 Renamed main script to be more correct for what it does. 2019-01-12 03:07:16 +01:00
Erwin de Haan
4b00b0cc87 Fixed fedora rpm build unexpected dependency on liblttng-ust. Fixed the docker builds and added manifest generation. 2019-01-12 03:04:36 +01:00
Erwin de Haan
74507099ad Added git submodules command. Converted RPM to build from local tree. Added all the execution bits to the build scripts. 2019-01-12 01:49:46 +01:00
Erwin de Haan
0bb08b3f8d Added debian bin folder. 2019-01-11 23:35:14 +01:00
Erwin de Haan
21098eb861 Moved rpm package and edited the package slightly, to build the project correctly. 2019-01-11 23:22:50 +01:00
Erwin de Haan
94933722c4 Merge branch 'rpm-package' into build-system-consolidation 2019-01-11 23:12:19 +01:00
Thomas Büttner
3f9b005885 Fix typo 2019-01-11 20:21:40 +01:00
Thomas Büttner
559ecb2afc Fix permissions for the main binary.
The /usr/lib64/jellyfin/jellyfin binary has 0744 permission after build by dotnet so set explicit permission to 0755 in .spec
2019-01-11 20:06:08 +01:00
grafixeyehero
862fe1a290 add grafixeyehero to CONTRIBUTORS 2019-01-11 19:52:26 +03:00
Thomas Büttner
5ffea816a1 Change EnvironmentFile path to /etc/sysconfig 2019-01-11 17:43:42 +01:00
Thomas Büttner
7bda212958 Bump spec version to 10.0.2
Signed-off-by: Thomas Büttner <thomas@vergesslicher.tech>
2019-01-11 17:05:28 +01:00
Thomas Büttner
101f47b6d4 Fix typo
Signed-off-by: Thomas Büttner <thomas@vergesslicher.tech>
2019-01-11 17:02:52 +01:00
Thomas Büttner
b6c0e5d472 Also remove DB mirgration part from README
Signed-off-by: Thomas Büttner <thomas@vergesslicher.tech>
2019-01-11 17:01:22 +01:00
Thomas Büttner
40e509588e Remove explicit permissions for files who don't need them.
Signed-off-by: Thomas Büttner <thomas@vergesslicher.tech>
2019-01-11 16:58:41 +01:00
Thomas Büttner
fa01c4f02e Remove DB migration script also from %files.
Signed-off-by: Thomas Büttner <thomas@vergesslicher.tech>
2019-01-11 16:44:18 +01:00
Thomas Büttner
cb328e4b6f Remove DB migration script.
Signed-off-by: Thomas Büttner <thomas@vergesslicher.tech>
2019-01-11 16:42:26 +01:00
Thomas Büttner
8eb2fe1b58 Remove references to Debian package
Signed-off-by: Thomas Büttner <thomas@vergesslicher.tech>
2019-01-11 16:15:06 +01:00
Joshua M. Boniface
c888879599 Merge pull request #541 from cvium/fix_providermanager_guid
Change ItemId to Guid in ProviderManager
2019-01-11 09:17:25 -05:00
Erwin de Haan
e2751d42e8 Merge branch 'dev' into code-cleanup 2019-01-11 12:50:36 +01:00
Andrew Rabert
e5c2dbdf23 Merge pull request #540 from joshuaboniface/api-keys
Update Emby API keys to our own
2019-01-10 23:02:29 -05:00
Joshua M. Boniface
15c89d281e Merge pull request #506 from hawken93/linting
Removing tabs and trailing whitespace
2019-01-10 19:54:18 -05:00
grafixeyehero
9659decef0 fix the forgotpasswordpin
fix passwordreset.txt print
2019-01-11 01:15:00 +03:00
Joshua Boniface
fddd72a3bd Update Fanart commented-out API key to our own 2019-01-10 15:17:08 -05:00
Joshua Boniface
8489febcc7 Update Omdb API key to our own 2019-01-10 15:17:07 -05:00
Erwin de Haan
ec1f5dc317 Mayor code cleanup
Add Argument*Exceptions now use proper nameof operators.

Added exception messages to quite a few Argument*Exceptions.

Fixed rethorwing to be proper syntax.

Added a ton of null checkes. (This is only a start, there are about 500 places that need proper null handling)

Added some TODOs to log certain exceptions.

Fix sln again.

Fixed all AssemblyInfo's and added proper copyright (where I could find them)

We live in *current year*.

Fixed the use of braces.

Fixed a ton of properties, and made a fair amount of functions static that should be and can be static.

Made more Methods that should be static static.

You can now use static to find bad functions!

Removed unused variable. And added one more proper XML comment.
2019-01-10 20:38:53 +01:00
Erwin de Haan
47e36b6791 Add linux-arm and linux-arm64 native. 2019-01-10 20:18:39 +01:00
Erwin de Haan
399a079dd4 Build scripts and build system consolidation.
Squashed commit.
2019-01-10 19:45:30 +01:00
Anthony Lavado
5900ab8c68 Update OpenSubtitles User Agent to our own 2019-01-10 13:26:52 -05:00
cvium
0abe5b6ec3 Change ItemId to Guid like all the others 2019-01-10 15:30:26 +01:00
Andrew Rabert
3d867c2c46 Merge pull request #516 from Bond-009/env
Remove useless properties from IEnvironmentInfo
2019-01-09 22:08:58 -05:00
Andrew Rabert
7a832045d6 Merge pull request #424 from dkanada/submodule
add jellyfin-web as submodule
2019-01-09 22:05:11 -05:00
Joshua Boniface
7603b8d0fe Update TheTVDB API key to our own 2019-01-09 12:44:48 -05:00
Joshua Boniface
04ab1daa02 Update FanArt API key to our own 2019-01-09 12:24:16 -05:00
Joshua Boniface
41da58206f Update TheAudioDB API key to our own 2019-01-09 12:19:10 -05:00
Joshua Boniface
909409bb6d Update TheMovieDB API key to our own 2019-01-09 12:11:42 -05:00
Bond-009
f454b753f2 separate path with comma
Co-Authored-By: dkanada <dkanada@users.noreply.github.com>
2019-01-10 00:23:44 +09:00
dkanada
9de66e9e87 add jellyfin-web as submodule 2019-01-09 23:35:05 +09:00
Thomas Büttner
4e7f475491 Also symlink logs to /var/log, changed changelog to lastest entry of the debian package
Signed-off-by: Thomas Büttner <thomas@vergesslicher.tech>
2019-01-08 19:44:51 +01:00
Thomas Büttner
ad36f9ec89 Add rpm build script for fedora and update README
Signed-off-by: Thomas Büttner <thomas@vergesslicher.tech>
2019-01-08 19:04:52 +01:00
Thomas Büttner
7f4a073b05 Add %post script to move exitsting config to /etc/jellyfin and symlink it.
Signed-off-by: Thomas Büttner <thomas@vergesslicher.tech>
2019-01-08 18:56:55 +01:00
Bond_009
f520ddc966 Remove useless properties from IEnvironmentInfo 2019-01-08 17:35:56 +01:00
hawken
bd169e4fd4 remove trailing whitespace 2019-01-07 23:27:46 +00:00
hawken
ba1794f64b Remove tabs and trailing whitespace 2019-01-07 23:24:34 +00:00
Thomas Büttner
0e455b0f62 fixed restart.sh permissions
Signed-off-by: Thomas Büttner <thomas@vergesslicher.tech>
2019-01-07 19:28:04 +01:00
Thomas Büttner
cbff18edb5 Add logging and config directories
Signed-off-by: Thomas Büttner <thomas@vergesslicher.tech>
2019-01-07 18:51:37 +01:00
Bond_009
07a8e49c4b Cleanup some small things 2019-01-06 20:35:36 +01:00
LogicalPhallacy
8ff89fdc0c Merge pull request #5 from jellyfin/dev
Dev
2019-01-05 16:22:18 -08:00
Thomas Büttner
79229fe3ae bump to 10.0.0 and use simple version scheme
Signed-off-by: Thomas Büttner <thomas@vergesslicher.tech>
2019-01-05 22:44:46 +01:00
Thomas Büttner
90ab6a40fc add Firewalld serivce.xml
Signed-off-by: Thomas Büttner <thomas@vergesslicher.tech>
2019-01-05 22:06:10 +01:00
Thomas Büttner
b3de385d5b Re-add sudo policy for in-app service restart.
Signed-off-by: Thomas Büttner <thomas@vergesslicher.tech>
2019-01-05 21:30:45 +01:00
Thomas Büttner
0eafc3fd11 Update update-db.sh 2019-01-05 17:47:57 +01:00
Thomas Büttner
a968913e9f CentOS Build fails since it has no Recommends: tag
Signed-off-by: Thomas Büttner <thomas@tartaros.tech>
2019-01-05 11:22:03 +01:00
Thomas Büttner
a2c1ec0de3 Add RPM package spec
Signed-off-by: Thomas Büttner <thomas@tartaros.tech>
2019-01-05 11:14:24 +01:00
Phallacy
4eaeee7be2 minor: copy install.bat for rename 2019-01-01 20:28:29 -08:00
LogicalPhallacy
443218e3f1 Merge pull request #4 from jellyfin/dev
Dev
2019-01-01 11:47:57 -08:00
1827 changed files with 22162 additions and 42022 deletions

View File

@@ -1,5 +1,10 @@
.git
.dockerignore
Dockerfile
Dockerfile.arm
Dockerfile.arm64
CONTRIBUTORS.md
README.md
deployment/*/dist
deployment/*/pkg-dist
deployment/collect-dist/

View File

@@ -9,4 +9,4 @@ steps:
- name: build
image: microsoft/dotnet:2-sdk
commands:
- dotnet publish --configuration release --output /release
- dotnet publish --configuration release --output /release Jellyfin.Server

View File

@@ -1,13 +1,13 @@
# With more recent updates Visual Studio 2017 supports EditorConfig files out of the box
# Visual Studio Code needs an extension: https://github.com/editorconfig/editorconfig-vscode
# For emacs, vim, np++ and other editors, see here: https://github.com/editorconfig
###############################
# Core EditorConfig Options #
###############################
# All files
[*]
indent_style = space
###############################
# Core EditorConfig Options #
###############################
root = true
# All files
[*]
indent_style = space
indent_size = 4
charset = utf-8
trim_trailing_whitespace = true
@@ -15,119 +15,117 @@ insert_final_newline = true
end_of_line = lf
max_line_length = null
# Code files
[*.{cs,csx,vb,vbx}]
indent_size = 4
insert_final_newline = true
charset = utf-8
###############################
# .NET Coding Conventions #
###############################
[*.{cs,vb}]
# Organize usings
dotnet_sort_system_directives_first = true
# this. preferences
dotnet_style_qualification_for_field = false:silent
dotnet_style_qualification_for_property = false:silent
dotnet_style_qualification_for_method = false:silent
dotnet_style_qualification_for_event = false:silent
# Language keywords vs BCL types preferences
dotnet_style_predefined_type_for_locals_parameters_members = true:silent
dotnet_style_predefined_type_for_member_access = true:silent
# Parentheses preferences
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
# Modifier preferences
dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
dotnet_style_readonly_field = true:suggestion
# Expression-level preferences
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:silent
dotnet_prefer_inferred_tuple_names = true:suggestion
dotnet_prefer_inferred_anonymous_type_member_names = true:suggestion
dotnet_style_prefer_auto_properties = true:silent
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
dotnet_style_prefer_conditional_expression_over_return = true:silent
###############################
# Naming Conventions #
###############################
# Style Definitions
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
# Use PascalCase for constant fields
dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
dotnet_naming_symbols.constant_fields.applicable_kinds = field
dotnet_naming_symbols.constant_fields.applicable_accessibilities = *
dotnet_naming_symbols.constant_fields.required_modifiers = const
###############################
# C# Coding Conventions #
###############################
[*.cs]
# var preferences
csharp_style_var_for_built_in_types = true:silent
csharp_style_var_when_type_is_apparent = true:silent
csharp_style_var_elsewhere = true:silent
# Expression-bodied members
csharp_style_expression_bodied_methods = false:silent
csharp_style_expression_bodied_constructors = false:silent
csharp_style_expression_bodied_operators = false:silent
csharp_style_expression_bodied_properties = true:silent
csharp_style_expression_bodied_indexers = true:silent
csharp_style_expression_bodied_accessors = true:silent
# Pattern matching preferences
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
# Null-checking preferences
csharp_style_throw_expression = true:suggestion
csharp_style_conditional_delegate_call = true:suggestion
# Modifier preferences
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion
# Expression-level preferences
csharp_prefer_braces = true:silent
csharp_style_deconstructed_variable_declaration = true:suggestion
csharp_prefer_simple_default_expression = true:suggestion
csharp_style_pattern_local_over_anonymous_function = true:suggestion
csharp_style_inlined_variable_declaration = true:suggestion
###############################
# C# Formatting Rules #
###############################
# New line preferences
csharp_new_line_before_open_brace = all
csharp_new_line_before_else = true
csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_between_query_expression_clauses = true
# Indentation preferences
csharp_indent_case_contents = true
csharp_indent_switch_labels = true
csharp_indent_labels = flush_left
# Space preferences
csharp_space_after_cast = false
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_around_binary_operators = before_and_after
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_between_method_call_empty_parameter_list_parentheses = false
# Wrapping preferences
csharp_preserve_single_line_statements = true
csharp_preserve_single_line_blocks = true
###############################
# VB Coding Conventions #
###############################
[*.vb]
# Modifier preferences
visual_basic_preferred_modifier_order = Partial,Default,Private,Protected,Public,Friend,NotOverridable,Overridable,MustOverride,Overloads,Overrides,MustInherit,NotInheritable,Static,Shared,Shadows,ReadOnly,WriteOnly,Dim,Const,WithEvents,Widening,Narrowing,Custom,Async:suggestion
# XML indentation
[*.{csproj,xml}]
indent_size = 2
###############################
# .NET Coding Conventions #
###############################
[*.{cs,vb}]
# Organize usings
dotnet_sort_system_directives_first = true
# this. preferences
dotnet_style_qualification_for_field = false:silent
dotnet_style_qualification_for_property = false:silent
dotnet_style_qualification_for_method = false:silent
dotnet_style_qualification_for_event = false:silent
# Language keywords vs BCL types preferences
dotnet_style_predefined_type_for_locals_parameters_members = true:silent
dotnet_style_predefined_type_for_member_access = true:silent
# Parentheses preferences
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
# Modifier preferences
dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
dotnet_style_readonly_field = true:suggestion
# Expression-level preferences
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:silent
dotnet_prefer_inferred_tuple_names = true:suggestion
dotnet_prefer_inferred_anonymous_type_member_names = true:suggestion
dotnet_style_prefer_auto_properties = true:silent
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
dotnet_style_prefer_conditional_expression_over_return = true:silent
###############################
# Naming Conventions #
###############################
# Style Definitions
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
# Use PascalCase for constant fields
dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
dotnet_naming_symbols.constant_fields.applicable_kinds = field
dotnet_naming_symbols.constant_fields.applicable_accessibilities = *
dotnet_naming_symbols.constant_fields.required_modifiers = const
###############################
# C# Coding Conventions #
###############################
[*.cs]
# var preferences
csharp_style_var_for_built_in_types = true:silent
csharp_style_var_when_type_is_apparent = true:silent
csharp_style_var_elsewhere = true:silent
# Expression-bodied members
csharp_style_expression_bodied_methods = false:silent
csharp_style_expression_bodied_constructors = false:silent
csharp_style_expression_bodied_operators = false:silent
csharp_style_expression_bodied_properties = true:silent
csharp_style_expression_bodied_indexers = true:silent
csharp_style_expression_bodied_accessors = true:silent
# Pattern matching preferences
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
# Null-checking preferences
csharp_style_throw_expression = true:suggestion
csharp_style_conditional_delegate_call = true:suggestion
# Modifier preferences
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion
# Expression-level preferences
csharp_prefer_braces = true:silent
csharp_style_deconstructed_variable_declaration = true:suggestion
csharp_prefer_simple_default_expression = true:suggestion
csharp_style_pattern_local_over_anonymous_function = true:suggestion
csharp_style_inlined_variable_declaration = true:suggestion
###############################
# C# Formatting Rules #
###############################
# New line preferences
csharp_new_line_before_open_brace = all
csharp_new_line_before_else = true
csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_between_query_expression_clauses = true
# Indentation preferences
csharp_indent_case_contents = true
csharp_indent_switch_labels = true
csharp_indent_labels = flush_left
# Space preferences
csharp_space_after_cast = false
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_around_binary_operators = before_and_after
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_between_method_call_empty_parameter_list_parentheses = false
# Wrapping preferences
csharp_preserve_single_line_statements = true
csharp_preserve_single_line_blocks = true
###############################
# VB Coding Conventions #
###############################
[*.vb]
# Modifier preferences
visual_basic_preferred_modifier_order = Partial,Default,Private,Protected,Public,Friend,NotOverridable,Overridable,MustOverride,Overloads,Overrides,MustInherit,NotInheritable,Static,Shared,Shadows,ReadOnly,WriteOnly,Dim,Const,WithEvents,Widening,Narrowing,Custom,Async:suggestion

View File

@@ -8,23 +8,23 @@ assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
<!-- A clear and concise description of what the bug is. -->
**To Reproduce**
Steps to reproduce the behavior:
<!-- Steps to reproduce the behavior: -->
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
<!-- A clear and concise description of what you expected to happen. -->
**Logs**
Please paste any log errors.
<!-- Please paste any log errors. -->
**Screenshots**
If applicable, add screenshots to help explain your problem.
<!-- If applicable, add screenshots to help explain your problem. -->
**System (please complete the following information):**
- OS: [e.g. Docker, Debian, Windows]
@@ -32,4 +32,4 @@ If applicable, add screenshots to help explain your problem.
- Jellyfin Version: [e.g. 10.0.1]
**Additional context**
Add any other context about the problem here.
<!-- Add any other context about the problem here. -->

View File

@@ -8,13 +8,13 @@ assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
<!-- A clear and concise description of what you want to happen. -->
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
<!-- A clear and concise description of any alternative solutions or features you've considered. -->
**Additional context**
Add any other context or screenshots about the feature request here.
<!-- Add any other context or screenshots about the feature request here. -->

View File

@@ -8,7 +8,7 @@ assignees: ''
---
**Describe the feature you'd like**
A clear and concise description of what you want to happen.
<!-- A clear and concise description of what you want to happen. -->
**Additional context**
Add any other context or screenshots about the feature request here.
<!-- Add any other context or screenshots about the feature request here. -->

View File

@@ -1,9 +1,11 @@
<!--
Ensure your title is short, descriptive, and in the imperative mood (Fix X, Change Y, instead of Fixed X, Changed Y).
For a good inspiration of what to write in commit messages and PRs please review https://chris.beams.io/posts/git-commit/ and our https://jellyfin.readthedocs.io/en/latest/developer-docs/contributing/ page.
-->
**Changes**
Describe your changes here in 1-5 sentences.
<!-- Describe your changes here in 1-5 sentences. -->
**Issues**
Tag any issues that this PR solves here.
Fixes #
<!-- Tag any issues that this PR solves here.
ex. Fixes # -->

37
.gitignore vendored
View File

@@ -1,5 +1,3 @@
!*
.directory
#################
@@ -49,6 +47,8 @@ ProgramData-UI*/
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
.vs/
# User-specific files
*.suo
*.user
@@ -204,7 +204,6 @@ $RECYCLE.BIN/
# Mac crap
.DS_Store
#############
## Python
#############
@@ -234,24 +233,34 @@ pip-log.txt
#Mr Developer
.mr.developer.cfg
MediaBrowser.WebDashboard/dashboard-ui/.idea/
/.vs
##########
# Rider
##########
.idea/
##########
# Visual Studio Code
##########
.vscode/
#########################
# Debian build artifacts
# Build artifacts
#########################
debian/.debhelper/
debian/*.debhelper
debian/debhelper-build-stamp
debian/files
debian/jellyfin.substvars
debian/jellyfin/
# Artifacts for debian-x64
deployment/debian-package-x64/pkg-src/.debhelper/
deployment/debian-package-x64/pkg-src/*.debhelper
deployment/debian-package-x64/pkg-src/debhelper-build-stamp
deployment/debian-package-x64/pkg-src/files
deployment/debian-package-x64/pkg-src/jellyfin.substvars
deployment/debian-package-x64/pkg-src/jellyfin/
# Don't ignore the debian/bin folder
!debian/bin/
!deployment/debian-package-x64/pkg-src/bin/
deployment/**/dist/
deployment/**/pkg-dist/
deployment/**/pkg-dist-tmp/
deployment/collect-dist/
jellyfin_version.ini

6
.gitmodules vendored
View File

@@ -1,3 +1,3 @@
[submodule "ThirdParty/taglib-sharp"]
path = ThirdParty/taglib-sharp
url = https://github.com/mono/taglib-sharp.git
[submodule "MediaBrowser.WebDashboard/jellyfin-web"]
path = MediaBrowser.WebDashboard/jellyfin-web
url = https://github.com/jellyfin/jellyfin-web.git

View File

@@ -1,4 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<ItemGroup>
<Compile Include="..\SharedVersion.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MediaBrowser.Model\MediaBrowser.Model.csproj" />

View File

@@ -1,105 +1,33 @@

namespace BDInfo
{
class BDInfoSettings
{
public static bool GenerateStreamDiagnostics
{
get
{
return true;
}
}
public static bool GenerateStreamDiagnostics => true;
public static bool EnableSSIF
{
get
{
return true;
}
}
public static bool EnableSSIF => true;
public static bool AutosaveReport
{
get
{
return false;
}
}
public static bool AutosaveReport => false;
public static bool GenerateFrameDataFile
{
get
{
return false;
}
}
public static bool GenerateFrameDataFile => false;
public static bool FilterLoopingPlaylists
{
get
{
return true;
}
}
public static bool FilterLoopingPlaylists => true;
public static bool FilterShortPlaylists
{
get
{
return false;
}
}
public static bool FilterShortPlaylists => false;
public static int FilterShortPlaylistsValue
{
get
{
return 0;
}
}
public static int FilterShortPlaylistsValue => 0;
public static bool UseImagePrefix
{
get
{
return false;
}
}
public static bool UseImagePrefix => false;
public static string UseImagePrefixValue
{
get
{
return null;
}
}
public static string UseImagePrefixValue => null;
/// <summary>
/// Setting this to false throws an IComparer error on some discs.
/// </summary>
public static bool KeepStreamOrder
{
get
{
return true;
}
}
public static bool KeepStreamOrder => true;
public static bool GenerateTextSummary
{
get
{
return false;
}
}
public static bool GenerateTextSummary => false;
public static string LastPath
{
get
{
return string.Empty;
}
}
public static string LastPath => string.Empty;
}
}

View File

@@ -1,4 +1,4 @@
//============================================================================
//============================================================================
// BDInfo - Blu-ray Video and Audio Analysis Tool
// Copyright © 2010 Cinema Squid
//
@@ -22,7 +22,6 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.Text;
namespace BDInfo
{
@@ -72,12 +71,11 @@ namespace BDInfo
public event OnPlaylistFileScanError PlaylistFileScanError;
public BDROM(
string path, IFileSystem fileSystem, ITextEncoding textEncoding)
public BDROM(string path, IFileSystem fileSystem)
{
if (string.IsNullOrEmpty(path))
{
throw new ArgumentNullException("path");
throw new ArgumentNullException(nameof(path));
}
_fileSystem = fileSystem;
@@ -94,7 +92,7 @@ namespace BDInfo
}
DirectoryRoot =
_fileSystem.GetDirectoryInfo(_fileSystem.GetDirectoryName(DirectoryBDMV.FullName));
_fileSystem.GetDirectoryInfo(Path.GetDirectoryName(DirectoryBDMV.FullName));
DirectoryBDJO =
GetDirectory("BDJO", DirectoryBDMV, 0);
DirectoryCLIPINF =
@@ -152,7 +150,7 @@ namespace BDInfo
Is3D = true;
}
if (_fileSystem.FileExists(Path.Combine(DirectoryRoot.FullName, "FilmIndex.xml")))
if (File.Exists(Path.Combine(DirectoryRoot.FullName, "FilmIndex.xml")))
{
IsDBOX = true;
}
@@ -164,17 +162,17 @@ namespace BDInfo
if (DirectoryPLAYLIST != null)
{
FileSystemMetadata[] files = GetFiles(DirectoryPLAYLIST.FullName, ".mpls").ToArray();
foreach (FileSystemMetadata file in files)
foreach (var file in files)
{
PlaylistFiles.Add(
file.Name.ToUpper(), new TSPlaylistFile(this, file, _fileSystem, textEncoding));
file.Name.ToUpper(), new TSPlaylistFile(this, file, _fileSystem));
}
}
if (DirectorySTREAM != null)
{
FileSystemMetadata[] files = GetFiles(DirectorySTREAM.FullName, ".m2ts").ToArray();
foreach (FileSystemMetadata file in files)
foreach (var file in files)
{
StreamFiles.Add(
file.Name.ToUpper(), new TSStreamFile(file, _fileSystem));
@@ -184,17 +182,17 @@ namespace BDInfo
if (DirectoryCLIPINF != null)
{
FileSystemMetadata[] files = GetFiles(DirectoryCLIPINF.FullName, ".clpi").ToArray();
foreach (FileSystemMetadata file in files)
foreach (var file in files)
{
StreamClipFiles.Add(
file.Name.ToUpper(), new TSStreamClipFile(file, _fileSystem, textEncoding));
file.Name.ToUpper(), new TSStreamClipFile(file, _fileSystem));
}
}
if (DirectorySSIF != null)
{
FileSystemMetadata[] files = GetFiles(DirectorySSIF.FullName, ".ssif").ToArray();
foreach (FileSystemMetadata file in files)
foreach (var file in files)
{
InterleavedFiles.Add(
file.Name.ToUpper(), new TSInterleavedFile(file));
@@ -214,8 +212,8 @@ namespace BDInfo
public void Scan()
{
List<TSStreamClipFile> errorStreamClipFiles = new List<TSStreamClipFile>();
foreach (TSStreamClipFile streamClipFile in StreamClipFiles.Values)
var errorStreamClipFiles = new List<TSStreamClipFile>();
foreach (var streamClipFile in StreamClipFiles.Values)
{
try
{
@@ -235,11 +233,11 @@ namespace BDInfo
break;
}
}
else throw ex;
else throw;
}
}
foreach (TSStreamFile streamFile in StreamFiles.Values)
foreach (var streamFile in StreamFiles.Values)
{
string ssifName = Path.GetFileNameWithoutExtension(streamFile.Name) + ".SSIF";
if (InterleavedFiles.ContainsKey(ssifName))
@@ -252,8 +250,8 @@ namespace BDInfo
StreamFiles.Values.CopyTo(streamFiles, 0);
Array.Sort(streamFiles, CompareStreamFiles);
List<TSPlaylistFile> errorPlaylistFiles = new List<TSPlaylistFile>();
foreach (TSPlaylistFile playlistFile in PlaylistFiles.Values)
var errorPlaylistFiles = new List<TSPlaylistFile>();
foreach (var playlistFile in PlaylistFiles.Values)
{
try
{
@@ -273,19 +271,19 @@ namespace BDInfo
break;
}
}
else throw ex;
else throw;
}
}
List<TSStreamFile> errorStreamFiles = new List<TSStreamFile>();
foreach (TSStreamFile streamFile in streamFiles)
var errorStreamFiles = new List<TSStreamFile>();
foreach (var streamFile in streamFiles)
{
try
{
List<TSPlaylistFile> playlists = new List<TSPlaylistFile>();
foreach (TSPlaylistFile playlist in PlaylistFiles.Values)
var playlists = new List<TSPlaylistFile>();
foreach (var playlist in PlaylistFiles.Values)
{
foreach (TSStreamClip streamClip in playlist.StreamClips)
foreach (var streamClip in playlist.StreamClips)
{
if (streamClip.Name == streamFile.Name)
{
@@ -310,16 +308,16 @@ namespace BDInfo
break;
}
}
else throw ex;
else throw;
}
}
foreach (TSPlaylistFile playlistFile in PlaylistFiles.Values)
foreach (var playlistFile in PlaylistFiles.Values)
{
playlistFile.Initialize();
if (!Is50Hz)
{
foreach (TSVideoStream videoStream in playlistFile.VideoStreams)
foreach (var videoStream in playlistFile.VideoStreams)
{
if (videoStream.FrameRate == TSFrameRate.FRAMERATE_25 ||
videoStream.FrameRate == TSFrameRate.FRAMERATE_50)
@@ -336,7 +334,7 @@ namespace BDInfo
{
if (string.IsNullOrEmpty(path))
{
throw new ArgumentNullException("path");
throw new ArgumentNullException(nameof(path));
}
FileSystemMetadata dir = _fileSystem.GetDirectoryInfo(path);
@@ -347,7 +345,7 @@ namespace BDInfo
{
return dir;
}
var parentFolder = _fileSystem.GetDirectoryName(dir.FullName);
var parentFolder = Path.GetDirectoryName(dir.FullName);
if (string.IsNullOrEmpty(parentFolder))
{
dir = null;
@@ -369,7 +367,7 @@ namespace BDInfo
if (dir != null)
{
FileSystemMetadata[] children = _fileSystem.GetDirectories(dir.FullName).ToArray();
foreach (FileSystemMetadata child in children)
foreach (var child in children)
{
if (string.Equals(child.Name, name, StringComparison.OrdinalIgnoreCase))
{
@@ -378,7 +376,7 @@ namespace BDInfo
}
if (searchDepth > 0)
{
foreach (FileSystemMetadata child in children)
foreach (var child in children)
{
GetDirectory(
name, child, searchDepth - 1);
@@ -395,7 +393,7 @@ namespace BDInfo
//if (!ExcludeDirs.Contains(directoryInfo.Name.ToUpper())) // TODO: Keep?
{
FileSystemMetadata[] pathFiles = _fileSystem.GetFiles(directoryInfo.FullName).ToArray();
foreach (FileSystemMetadata pathFile in pathFiles)
foreach (var pathFile in pathFiles)
{
if (pathFile.Extension.ToUpper() == ".SSIF")
{
@@ -405,7 +403,7 @@ namespace BDInfo
}
FileSystemMetadata[] pathChildren = _fileSystem.GetDirectories(directoryInfo.FullName).ToArray();
foreach (FileSystemMetadata pathChild in pathChildren)
foreach (var pathChild in pathChildren)
{
size += GetDirectorySize(pathChild);
}

View File

@@ -1,4 +1,4 @@
//============================================================================
//============================================================================
// BDInfo - Blu-ray Video and Audio Analysis Tool
// Copyright © 2010 Cinema Squid
//

View File

@@ -1,29 +1,21 @@
using System.Resources;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Resources;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("BDInfo")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("BDInfo")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyCompany("Jellyfin Project")]
[assembly: AssemblyProduct("Jellyfin: The Free Software Media System")]
[assembly: AssemblyCopyright("Copyright © 2016 CinemaSquid. Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License Version 2")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.1")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

View File

@@ -1,5 +1,5 @@
The source is taken from the BDRom folder of this project:
The source is taken from the BDRom folder of this project:
http://www.cinemasquid.com/blu-ray/tools/bdinfo
BDInfoSettings was taken from the FormSettings class, and changed so that the settings all return defaults.
BDInfoSettings was taken from the FormSettings class, and changed so that the settings all return defaults.

View File

@@ -1,4 +1,4 @@
//============================================================================
//============================================================================
// BDInfo - Blu-ray Video and Audio Analysis Tool
// Copyright © 2010 Cinema Squid
//
@@ -24,7 +24,7 @@ namespace BDInfo
{
public abstract class TSCodecAC3
{
private static byte[] eac3_blocks = new byte[] { 1, 2, 3, 6 };
private static byte[] eac3_blocks = new byte[] { 1, 2, 3, 6 };
public static void Scan(
TSAudioStream stream,

View File

@@ -1,4 +1,4 @@
//============================================================================
//============================================================================
// BDInfo - Blu-ray Video and Audio Analysis Tool
// Copyright © 2010 Cinema Squid
//

View File

@@ -1,4 +1,4 @@
//============================================================================
//============================================================================
// BDInfo - Blu-ray Video and Audio Analysis Tool
// Copyright © 2010 Cinema Squid
//
@@ -148,7 +148,7 @@ namespace BDInfo
stream.IsVBR = true;
stream.IsInitialized = true;
break;
default:
stream.IsVBR = false;
stream.IsInitialized = true;

View File

@@ -1,4 +1,4 @@
//============================================================================
//============================================================================
// BDInfo - Blu-ray Video and Audio Analysis Tool
// Copyright © 2010 Cinema Squid
//
@@ -22,9 +22,9 @@ namespace BDInfo
{
public abstract class TSCodecDTSHD
{
private static int[] SampleRates = new int[]
private static int[] SampleRates = new int[]
{ 0x1F40, 0x3E80, 0x7D00, 0x0FA00, 0x1F400, 0x5622, 0x0AC44, 0x15888, 0x2B110, 0x56220, 0x2EE0, 0x5DC0, 0x0BB80, 0x17700, 0x2EE00, 0x5DC00 };
public static void Scan(
TSAudioStream stream,
TSStreamBuffer buffer,
@@ -131,7 +131,7 @@ namespace BDInfo
else
{
AssetSizes[i] = buffer.ReadBits(16) + 1;
}
}
}
for (int i = 0; i < nuNumAssets; i++)
{
@@ -189,7 +189,7 @@ namespace BDInfo
}
stream.SampleRate = SampleRates[nuMaxSampleRate];
stream.BitDepth = nuBitResolution;
stream.LFE = 0;
if ((nuSpkrActivityMask & 0x8) == 0x8)
{
@@ -211,7 +211,7 @@ namespace BDInfo
// TODO
if (stream.CoreStream != null)
{
TSAudioStream coreStream = (TSAudioStream)stream.CoreStream;
var coreStream = (TSAudioStream)stream.CoreStream;
if (coreStream.AudioMode == TSAudioMode.Extended &&
stream.ChannelCount == 5)
{
@@ -240,7 +240,7 @@ namespace BDInfo
stream.IsInitialized = true;
}
stream.IsInitialized = (stream.BitRate > 0 ? true : false);
}
}
}
}
}

View File

@@ -1,4 +1,4 @@
//============================================================================
//============================================================================
// BDInfo - Blu-ray Video and Audio Analysis Tool
// Copyright © 2010 Cinema Squid
//

View File

@@ -1,4 +1,4 @@
//============================================================================
//============================================================================
// BDInfo - Blu-ray Video and Audio Analysis Tool
// Copyright © 2010 Cinema Squid
//
@@ -33,7 +33,7 @@ namespace BDInfo
int pictureParse = 0;
int sequenceHeaderParse = 0;
int extensionParse = 0;
int sequenceExtensionParse = 0;
int sequenceExtensionParse = 0;
for (int i = 0; i < buffer.Length; i++)
{
@@ -189,7 +189,7 @@ namespace BDInfo
#if DEBUG
if (sequenceExtensionParse == 0)
{
uint sequenceExtension =
uint sequenceExtension =
((parse & 0x8) >> 3);
if (sequenceExtension == 0)
{

View File

@@ -1,4 +1,4 @@
//============================================================================
//============================================================================
// BDInfo - Blu-ray Video and Audio Analysis Tool
// Copyright © 2010 Cinema Squid
//

View File

@@ -1,4 +1,4 @@
//============================================================================
//============================================================================
// BDInfo - Blu-ray Video and Audio Analysis Tool
// Copyright © 2010 Cinema Squid
//
@@ -36,7 +36,7 @@ namespace BDInfo
for (int i = 0; i < buffer.Length; i++)
{
sync = (sync << 8) + buffer.ReadByte();
if (sync == 0xF8726FBA)
if (sync == 0xF8726FBA)
{
syncFound = true;
break;
@@ -63,7 +63,7 @@ namespace BDInfo
int ratebits = buffer.ReadBits(4);
if (ratebits != 0xF)
{
stream.SampleRate =
stream.SampleRate =
(((ratebits & 8) > 0 ? 44100 : 48000) << (ratebits & 7));
}
int temp1 = buffer.ReadBits(8);
@@ -149,9 +149,9 @@ namespace BDInfo
int peak_bitrate = buffer.ReadBits(15);
peak_bitrate = (peak_bitrate * stream.SampleRate) >> 4;
double peak_bitdepth =
(double)peak_bitrate /
(stream.ChannelCount + stream.LFE) /
double peak_bitdepth =
(double)peak_bitrate /
(stream.ChannelCount + stream.LFE) /
stream.SampleRate;
if (peak_bitdepth > 14)
{
@@ -164,7 +164,7 @@ namespace BDInfo
#if DEBUG
System.Diagnostics.Debug.WriteLine(string.Format(
"{0}\t{1}\t{2:F2}",
"{0}\t{1}\t{2:F2}",
stream.PID, peak_bitrate, peak_bitdepth));
#endif
/*

View File

@@ -1,4 +1,4 @@
//============================================================================
//============================================================================
// BDInfo - Blu-ray Video and Audio Analysis Tool
// Copyright © 2010 Cinema Squid
//
@@ -50,18 +50,18 @@ namespace BDInfo
{
if ((parse & 0x80000000) == 0)
{
pictureType =
pictureType =
(uint)((parse & 0x78000000) >> 13);
}
else
{
pictureType =
pictureType =
(uint)((parse & 0x3c000000) >> 12);
}
}
else
{
pictureType =
pictureType =
(uint)((parse & 0xf0000000) >> 14);
}

View File

@@ -1,4 +1,4 @@
//============================================================================
//============================================================================
// BDInfo - Blu-ray Video and Audio Analysis Tool
// Copyright © 2010 Cinema Squid
//
@@ -17,7 +17,6 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//=============================================================================
using System.IO;
using MediaBrowser.Model.IO;
// TODO: Do more interesting things here...

View File

@@ -1,4 +1,4 @@
//============================================================================
//============================================================================
// BDInfo - Blu-ray Video and Audio Analysis Tool
// Copyright © 2010 Cinema Squid
//
@@ -23,14 +23,12 @@ using System.Collections.Generic;
using System.IO;
using System.Text;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.Text;
namespace BDInfo
{
public class TSPlaylistFile
{
private readonly IFileSystem _fileSystem;
private readonly ITextEncoding _textEncoding;
private FileSystemMetadata FileInfo = null;
public string FileType = null;
public bool IsInitialized = false;
@@ -42,7 +40,7 @@ namespace BDInfo
public List<double> Chapters = new List<double>();
public Dictionary<ushort, TSStream> Streams =
public Dictionary<ushort, TSStream> Streams =
new Dictionary<ushort, TSStream>();
public Dictionary<ushort, TSStream> PlaylistStreams =
new Dictionary<ushort, TSStream>();
@@ -50,45 +48,41 @@ namespace BDInfo
new List<TSStreamClip>();
public List<Dictionary<ushort, TSStream>> AngleStreams =
new List<Dictionary<ushort, TSStream>>();
public List<Dictionary<double, TSStreamClip>> AngleClips =
public List<Dictionary<double, TSStreamClip>> AngleClips =
new List<Dictionary<double, TSStreamClip>>();
public int AngleCount = 0;
public List<TSStream> SortedStreams =
public List<TSStream> SortedStreams =
new List<TSStream>();
public List<TSVideoStream> VideoStreams =
public List<TSVideoStream> VideoStreams =
new List<TSVideoStream>();
public List<TSAudioStream> AudioStreams =
public List<TSAudioStream> AudioStreams =
new List<TSAudioStream>();
public List<TSTextStream> TextStreams =
public List<TSTextStream> TextStreams =
new List<TSTextStream>();
public List<TSGraphicsStream> GraphicsStreams =
public List<TSGraphicsStream> GraphicsStreams =
new List<TSGraphicsStream>();
public TSPlaylistFile(
BDROM bdrom,
FileSystemMetadata fileInfo, IFileSystem fileSystem, ITextEncoding textEncoding)
public TSPlaylistFile(BDROM bdrom,
FileSystemMetadata fileInfo, IFileSystem fileSystem)
{
BDROM = bdrom;
FileInfo = fileInfo;
_fileSystem = fileSystem;
_textEncoding = textEncoding;
Name = fileInfo.Name.ToUpper();
}
public TSPlaylistFile(
BDROM bdrom,
public TSPlaylistFile(BDROM bdrom,
string name,
List<TSStreamClip> clips, IFileSystem fileSystem, ITextEncoding textEncoding)
List<TSStreamClip> clips, IFileSystem fileSystem)
{
BDROM = bdrom;
Name = name;
_fileSystem = fileSystem;
_textEncoding = textEncoding;
IsCustom = true;
foreach (TSStreamClip clip in clips)
foreach (var clip in clips)
{
TSStreamClip newClip = new TSStreamClip(
var newClip = new TSStreamClip(
clip.StreamFile, clip.StreamClipFile);
newClip.Name = clip.Name;
@@ -124,7 +118,7 @@ namespace BDInfo
get
{
ulong size = 0;
foreach (TSStreamClip clip in StreamClips)
foreach (var clip in StreamClips)
{
size += clip.InterleavedFileSize;
}
@@ -136,7 +130,7 @@ namespace BDInfo
get
{
ulong size = 0;
foreach (TSStreamClip clip in StreamClips)
foreach (var clip in StreamClips)
{
size += clip.FileSize;
}
@@ -148,7 +142,7 @@ namespace BDInfo
get
{
double length = 0;
foreach (TSStreamClip clip in StreamClips)
foreach (var clip in StreamClips)
{
if (clip.AngleIndex == 0)
{
@@ -164,7 +158,7 @@ namespace BDInfo
get
{
double length = 0;
foreach (TSStreamClip clip in StreamClips)
foreach (var clip in StreamClips)
{
length += clip.Length;
}
@@ -177,7 +171,7 @@ namespace BDInfo
get
{
ulong size = 0;
foreach (TSStreamClip clip in StreamClips)
foreach (var clip in StreamClips)
{
if (clip.AngleIndex == 0)
{
@@ -193,7 +187,7 @@ namespace BDInfo
get
{
ulong size = 0;
foreach (TSStreamClip clip in StreamClips)
foreach (var clip in StreamClips)
{
size += clip.PacketSize;
}
@@ -237,7 +231,7 @@ namespace BDInfo
Streams.Clear();
StreamClips.Clear();
fileStream = _fileSystem.OpenRead(FileInfo.FullName);
fileStream = File.OpenRead(FileInfo.FullName);
fileReader = new BinaryReader(fileStream);
byte[] data = new byte[fileStream.Length];
@@ -264,7 +258,7 @@ namespace BDInfo
int itemCount = ReadInt16(data, ref pos);
int subitemCount = ReadInt16(data, ref pos);
List<TSStreamClip> chapterClips = new List<TSStreamClip>();
var chapterClips = new List<TSStreamClip>();
for (int itemIndex = 0; itemIndex < itemCount; itemIndex++)
{
int itemStart = pos;
@@ -311,7 +305,7 @@ namespace BDInfo
if (outTime < 0) outTime &= 0x7FFFFFFF;
double timeOut = (double)outTime / 45000;
TSStreamClip streamClip = new TSStreamClip(
var streamClip = new TSStreamClip(
streamFile, streamClipFile);
streamClip.Name = streamFileName; //TODO
@@ -362,7 +356,7 @@ namespace BDInfo
FileInfo.Name, angleClipFileName));
}
TSStreamClip angleClip =
var angleClip =
new TSStreamClip(angleFile, angleClipFile);
angleClip.AngleIndex = angle + 1;
angleClip.TimeIn = streamClip.TimeIn;
@@ -388,46 +382,46 @@ namespace BDInfo
#if DEBUG
Debug.WriteLine(string.Format(
"{0} : {1} -> V:{2} A:{3} PG:{4} IG:{5} 2A:{6} 2V:{7} PIP:{8}",
Name, streamFileName, streamCountVideo, streamCountAudio, streamCountPG, streamCountIG,
"{0} : {1} -> V:{2} A:{3} PG:{4} IG:{5} 2A:{6} 2V:{7} PIP:{8}",
Name, streamFileName, streamCountVideo, streamCountAudio, streamCountPG, streamCountIG,
streamCountSecondaryAudio, streamCountSecondaryVideo, streamCountPIP));
#endif
for (int i = 0; i < streamCountVideo; i++)
{
TSStream stream = CreatePlaylistStream(data, ref pos);
var stream = CreatePlaylistStream(data, ref pos);
if (stream != null) PlaylistStreams[stream.PID] = stream;
}
for (int i = 0; i < streamCountAudio; i++)
{
TSStream stream = CreatePlaylistStream(data, ref pos);
var stream = CreatePlaylistStream(data, ref pos);
if (stream != null) PlaylistStreams[stream.PID] = stream;
}
for (int i = 0; i < streamCountPG; i++)
{
TSStream stream = CreatePlaylistStream(data, ref pos);
var stream = CreatePlaylistStream(data, ref pos);
if (stream != null) PlaylistStreams[stream.PID] = stream;
}
for (int i = 0; i < streamCountIG; i++)
{
TSStream stream = CreatePlaylistStream(data, ref pos);
var stream = CreatePlaylistStream(data, ref pos);
if (stream != null) PlaylistStreams[stream.PID] = stream;
}
for (int i = 0; i < streamCountSecondaryAudio; i++)
{
TSStream stream = CreatePlaylistStream(data, ref pos);
var stream = CreatePlaylistStream(data, ref pos);
if (stream != null) PlaylistStreams[stream.PID] = stream;
pos += 2;
}
for (int i = 0; i < streamCountSecondaryVideo; i++)
{
TSStream stream = CreatePlaylistStream(data, ref pos);
var stream = CreatePlaylistStream(data, ref pos);
if (stream != null) PlaylistStreams[stream.PID] = stream;
pos += 6;
}
/*
* TODO
*
*
for (int i = 0; i < streamCountPIP; i++)
{
TSStream stream = CreatePlaylistStream(data, ref pos);
@@ -446,7 +440,7 @@ namespace BDInfo
chapterIndex < chapterCount;
chapterIndex++)
{
int chapterType = data[pos+1];
int chapterType = data[pos + 1];
if (chapterType == 1)
{
@@ -459,7 +453,7 @@ namespace BDInfo
((long)data[pos + 6] << 8) +
((long)data[pos + 7]);
TSStreamClip streamClip = chapterClips[streamFileIndex];
var streamClip = chapterClips[streamFileIndex];
double chapterSeconds = (double)chapterTime / 45000;
@@ -499,8 +493,8 @@ namespace BDInfo
{
LoadStreamClips();
Dictionary<string, List<double>> clipTimes = new Dictionary<string, List<double>>();
foreach (TSStreamClip clip in StreamClips)
var clipTimes = new Dictionary<string, List<double>>();
foreach (var clip in StreamClips)
{
if (clip.AngleIndex == 0)
{
@@ -568,7 +562,7 @@ namespace BDInfo
int streamLength = data[pos++];
int streamPos = pos;
TSStreamType streamType = (TSStreamType)data[pos++];
var streamType = (TSStreamType)data[pos++];
switch (streamType)
{
case TSStreamType.MVC_VIDEO:
@@ -580,11 +574,11 @@ namespace BDInfo
case TSStreamType.MPEG2_VIDEO:
case TSStreamType.VC1_VIDEO:
TSVideoFormat videoFormat = (TSVideoFormat)
var videoFormat = (TSVideoFormat)
(data[pos] >> 4);
TSFrameRate frameRate = (TSFrameRate)
var frameRate = (TSFrameRate)
(data[pos] & 0xF);
TSAspectRatio aspectRatio = (TSAspectRatio)
var aspectRatio = (TSAspectRatio)
(data[pos + 1] >> 4);
stream = new TSVideoStream();
@@ -618,9 +612,9 @@ namespace BDInfo
int audioFormat = ReadByte(data, ref pos);
TSChannelLayout channelLayout = (TSChannelLayout)
var channelLayout = (TSChannelLayout)
(audioFormat >> 4);
TSSampleRate sampleRate = (TSSampleRate)
var sampleRate = (TSSampleRate)
(audioFormat & 0xF);
string audioLanguage = ReadString(data, 3, ref pos);
@@ -713,7 +707,7 @@ namespace BDInfo
{
referenceClip = StreamClips[0];
}
foreach (TSStreamClip clip in StreamClips)
foreach (var clip in StreamClips)
{
if (clip.StreamClipFile.Streams.Count > referenceClip.StreamClipFile.Streams.Count)
{
@@ -739,12 +733,12 @@ namespace BDInfo
}
}
foreach (TSStream clipStream
foreach (var clipStream
in referenceClip.StreamClipFile.Streams.Values)
{
if (!Streams.ContainsKey(clipStream.PID))
{
TSStream stream = clipStream.Clone();
var stream = clipStream.Clone();
Streams[clipStream.PID] = stream;
if (!IsCustom && !PlaylistStreams.ContainsKey(stream.PID))
@@ -780,7 +774,7 @@ namespace BDInfo
referenceClip.StreamFile.Streams.ContainsKey(4114) &&
!Streams.ContainsKey(4114))
{
TSStream stream = referenceClip.StreamFile.Streams[4114].Clone();
var stream = referenceClip.StreamFile.Streams[4114].Clone();
Streams[4114] = stream;
if (stream.IsVideoStream)
{
@@ -788,12 +782,12 @@ namespace BDInfo
}
}
foreach (TSStream clipStream
foreach (var clipStream
in referenceClip.StreamFile.Streams.Values)
{
if (Streams.ContainsKey(clipStream.PID))
{
TSStream stream = Streams[clipStream.PID];
var stream = Streams[clipStream.PID];
if (stream.StreamType != clipStream.StreamType) continue;
@@ -812,8 +806,8 @@ namespace BDInfo
else if (stream.IsAudioStream &&
clipStream.IsAudioStream)
{
TSAudioStream audioStream = (TSAudioStream)stream;
TSAudioStream clipAudioStream = (TSAudioStream)clipStream;
var audioStream = (TSAudioStream)stream;
var clipAudioStream = (TSAudioStream)clipStream;
if (clipAudioStream.ChannelCount > audioStream.ChannelCount)
{
@@ -864,7 +858,7 @@ namespace BDInfo
SortedStreams.Add(stream);
for (int i = 0; i < AngleCount; i++)
{
TSStream angleStream = stream.Clone();
var angleStream = stream.Clone();
angleStream.AngleIndex = i + 1;
AngleStreams[i][angleStream.PID] = angleStream;
SortedStreams.Add(angleStream);
@@ -901,7 +895,7 @@ namespace BDInfo
public void ClearBitrates()
{
foreach (TSStreamClip clip in StreamClips)
foreach (var clip in StreamClips)
{
clip.PayloadBytes = 0;
clip.PacketCount = 0;
@@ -909,7 +903,7 @@ namespace BDInfo
if (clip.StreamFile != null)
{
foreach (TSStream stream in clip.StreamFile.Streams.Values)
foreach (var stream in clip.StreamFile.Streams.Values)
{
stream.PayloadBytes = 0;
stream.PacketCount = 0;
@@ -924,7 +918,7 @@ namespace BDInfo
}
}
foreach (TSStream stream in SortedStreams)
foreach (var stream in SortedStreams)
{
stream.PayloadBytes = 0;
stream.PacketCount = 0;
@@ -955,7 +949,7 @@ namespace BDInfo
}
public int CompareVideoStreams(
TSVideoStream x,
TSVideoStream x,
TSVideoStream y)
{
if (x == null && y == null)
@@ -996,7 +990,7 @@ namespace BDInfo
}
public int CompareAudioStreams(
TSAudioStream x,
TSAudioStream x,
TSAudioStream y)
{
if (x == y)
@@ -1246,8 +1240,7 @@ namespace BDInfo
int count,
ref int pos)
{
string val =
_textEncoding.GetASCIIEncoding().GetString(data, pos, count);
string val = Encoding.ASCII.GetString(data, pos, count);
pos += count;

View File

@@ -1,4 +1,4 @@
//============================================================================
//============================================================================
// BDInfo - Blu-ray Video and Audio Analysis Tool
// Copyright © 2010 Cinema Squid
//
@@ -109,7 +109,7 @@ namespace BDInfo
public TSDescriptor Clone()
{
TSDescriptor descriptor =
var descriptor =
new TSDescriptor(Name, (byte)Value.Length);
Value.CopyTo(descriptor.Value, 0);
return descriptor;
@@ -142,26 +142,17 @@ namespace BDInfo
public double PacketSeconds = 0;
public int AngleIndex = 0;
public ulong PacketSize
{
get
{
return PacketCount * 192;
}
}
public ulong PacketSize => PacketCount * 192;
private string _LanguageCode;
public string LanguageCode
{
get
{
return _LanguageCode;
}
set
get => _LanguageCode;
set
{
_LanguageCode = value;
LanguageName = LanguageCodes.GetName(value);
}
}
}
public bool IsVideoStream
@@ -398,16 +389,10 @@ namespace BDInfo
}
}
public virtual string Description
{
get
{
return "";
}
}
public virtual string Description => "";
public abstract TSStream Clone();
protected void CopyTo(TSStream stream)
{
stream.PID = PID;
@@ -419,7 +404,7 @@ namespace BDInfo
if (Descriptors != null)
{
stream.Descriptors = new List<TSDescriptor>();
foreach (TSDescriptor descriptor in Descriptors)
foreach (var descriptor in Descriptors)
{
stream.Descriptors.Add(descriptor.Clone());
}
@@ -435,7 +420,7 @@ namespace BDInfo
public int Width;
public int Height;
public bool IsInterlaced;
public bool IsInterlaced;
public int FrameRateEnumerator;
public int FrameRateDenominator;
public TSAspectRatio AspectRatio;
@@ -444,10 +429,7 @@ namespace BDInfo
private TSVideoFormat _VideoFormat;
public TSVideoFormat VideoFormat
{
get
{
return _VideoFormat;
}
get => _VideoFormat;
set
{
_VideoFormat = value;
@@ -488,10 +470,7 @@ namespace BDInfo
private TSFrameRate _FrameRate;
public TSFrameRate FrameRate
{
get
{
return _FrameRate;
}
get => _FrameRate;
set
{
_FrameRate = value;
@@ -574,14 +553,14 @@ namespace BDInfo
public override TSStream Clone()
{
TSVideoStream stream = new TSVideoStream();
var stream = new TSVideoStream();
CopyTo(stream);
stream.VideoFormat = _VideoFormat;
stream.FrameRate = _FrameRate;
stream.Width = Width;
stream.Height = Height;
stream.IsInterlaced = IsInterlaced;
stream.IsInterlaced = IsInterlaced;
stream.FrameRateEnumerator = FrameRateEnumerator;
stream.FrameRateDenominator = FrameRateDenominator;
stream.AspectRatio = AspectRatio;
@@ -748,7 +727,7 @@ namespace BDInfo
public override TSStream Clone()
{
TSAudioStream stream = new TSAudioStream();
var stream = new TSAudioStream();
CopyTo(stream);
stream.SampleRate = SampleRate;
@@ -777,7 +756,7 @@ namespace BDInfo
public override TSStream Clone()
{
TSGraphicsStream stream = new TSGraphicsStream();
var stream = new TSGraphicsStream();
CopyTo(stream);
return stream;
}
@@ -793,7 +772,7 @@ namespace BDInfo
public override TSStream Clone()
{
TSTextStream stream = new TSTextStream();
var stream = new TSTextStream();
CopyTo(stream);
return stream;
}

View File

@@ -1,4 +1,4 @@
//============================================================================
//============================================================================
// BDInfo - Blu-ray Video and Audio Analysis Tool
// Copyright © 2010 Cinema Squid
//
@@ -37,21 +37,9 @@ namespace BDInfo
Stream = new MemoryStream(Buffer);
}
public long Length
{
get
{
return (long)BufferLength;
}
}
public long Length => (long)BufferLength;
public long Position
{
get
{
return Stream.Position;
}
}
public long Position => Stream.Position;
public void Add(
byte[] buffer,
@@ -123,7 +111,7 @@ namespace BDInfo
data += (Stream.ReadByte() << shift);
shift -= 8;
}
BitVector32 vector = new BitVector32(data);
var vector = new BitVector32(data);
int value = 0;
for (int i = SkipBits; i < SkipBits + bits; i++)

View File

@@ -1,4 +1,4 @@
//============================================================================
//============================================================================
// BDInfo - Blu-ray Video and Audio Analysis Tool
// Copyright © 2010 Cinema Squid
//
@@ -74,13 +74,7 @@ namespace BDInfo
}
}
public ulong PacketSize
{
get
{
return PacketCount * 192;
}
}
public ulong PacketSize => PacketCount * 192;
public ulong PacketBitRate
{
@@ -96,11 +90,11 @@ namespace BDInfo
public bool IsCompatible(TSStreamClip clip)
{
foreach (TSStream stream1 in StreamFile.Streams.Values)
foreach (var stream1 in StreamFile.Streams.Values)
{
if (clip.StreamFile.Streams.ContainsKey(stream1.PID))
{
TSStream stream2 = clip.StreamFile.Streams[stream1.PID];
var stream2 = clip.StreamFile.Streams[stream1.PID];
if (stream1.StreamType != stream2.StreamType)
{
return false;

View File

@@ -1,4 +1,4 @@
//============================================================================
//============================================================================
// BDInfo - Blu-ray Video and Audio Analysis Tool
// Copyright © 2010 Cinema Squid
//
@@ -23,28 +23,24 @@ using System.Collections.Generic;
using System.IO;
using System.Text;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.Text;
namespace BDInfo
{
public class TSStreamClipFile
{
private readonly IFileSystem _fileSystem;
private readonly ITextEncoding _textEncoding;
public FileSystemMetadata FileInfo = null;
public string FileType = null;
public bool IsValid = false;
public string Name = null;
public Dictionary<ushort, TSStream> Streams =
new Dictionary<ushort,TSStream>();
new Dictionary<ushort, TSStream>();
public TSStreamClipFile(
FileSystemMetadata fileInfo, IFileSystem fileSystem, ITextEncoding textEncoding)
public TSStreamClipFile(FileSystemMetadata fileInfo, IFileSystem fileSystem)
{
FileInfo = fileInfo;
_fileSystem = fileSystem;
_textEncoding = textEncoding;
Name = fileInfo.Name.ToUpper();
}
@@ -61,7 +57,7 @@ namespace BDInfo
#endif
Streams.Clear();
fileStream = _fileSystem.OpenRead(FileInfo.FullName);
fileStream = File.OpenRead(FileInfo.FullName);
fileReader = new BinaryReader(fileStream);
byte[] data = new byte[fileStream.Length];
@@ -69,8 +65,8 @@ namespace BDInfo
byte[] fileType = new byte[8];
Array.Copy(data, 0, fileType, 0, fileType.Length);
FileType = _textEncoding.GetASCIIEncoding().GetString(fileType, 0, fileType.Length);
FileType = Encoding.ASCII.GetString(fileType, 0, fileType.Length);
if (FileType != "HDMV0100" &&
FileType != "HDMV0200")
{
@@ -78,7 +74,7 @@ namespace BDInfo
"Clip info file {0} has an unknown file type {1}.",
FileInfo.Name, FileType));
}
#if DEBUG
#if DEBUG
Debug.WriteLine(string.Format(
"\tFileType: {0}", FileType));
#endif
@@ -110,12 +106,12 @@ namespace BDInfo
TSStream stream = null;
ushort PID = (ushort)
((clipData[streamOffset] << 8) +
((clipData[streamOffset] << 8) +
clipData[streamOffset + 1]);
streamOffset += 2;
TSStreamType streamType = (TSStreamType)
var streamType = (TSStreamType)
clipData[streamOffset + 1];
switch (streamType)
{
@@ -127,18 +123,18 @@ namespace BDInfo
case TSStreamType.MPEG1_VIDEO:
case TSStreamType.MPEG2_VIDEO:
case TSStreamType.VC1_VIDEO:
{
TSVideoFormat videoFormat = (TSVideoFormat)
(clipData[streamOffset + 2] >> 4);
TSFrameRate frameRate = (TSFrameRate)
(clipData[streamOffset + 2] & 0xF);
TSAspectRatio aspectRatio = (TSAspectRatio)
(clipData[streamOffset + 3] >> 4);
{
var videoFormat = (TSVideoFormat)
(clipData[streamOffset + 2] >> 4);
var frameRate = (TSFrameRate)
(clipData[streamOffset + 2] & 0xF);
var aspectRatio = (TSAspectRatio)
(clipData[streamOffset + 3] >> 4);
stream = new TSVideoStream();
((TSVideoStream)stream).VideoFormat = videoFormat;
((TSVideoStream)stream).AspectRatio = aspectRatio;
((TSVideoStream)stream).FrameRate = frameRate;
stream = new TSVideoStream();
((TSVideoStream)stream).VideoFormat = videoFormat;
((TSVideoStream)stream).AspectRatio = aspectRatio;
((TSVideoStream)stream).FrameRate = frameRate;
#if DEBUG
Debug.WriteLine(string.Format(
"\t{0} {1} {2} {3} {4}",
@@ -148,8 +144,8 @@ namespace BDInfo
frameRate,
aspectRatio));
#endif
}
break;
}
break;
case TSStreamType.AC3_AUDIO:
case TSStreamType.AC3_PLUS_AUDIO:
@@ -162,23 +158,22 @@ namespace BDInfo
case TSStreamType.LPCM_AUDIO:
case TSStreamType.MPEG1_AUDIO:
case TSStreamType.MPEG2_AUDIO:
{
byte[] languageBytes = new byte[3];
Array.Copy(clipData, streamOffset + 3,
languageBytes, 0, languageBytes.Length);
string languageCode =
_textEncoding.GetASCIIEncoding().GetString(languageBytes, 0, languageBytes.Length);
{
byte[] languageBytes = new byte[3];
Array.Copy(clipData, streamOffset + 3,
languageBytes, 0, languageBytes.Length);
string languageCode = Encoding.ASCII.GetString(languageBytes, 0, languageBytes.Length);
TSChannelLayout channelLayout = (TSChannelLayout)
(clipData[streamOffset + 2] >> 4);
TSSampleRate sampleRate = (TSSampleRate)
(clipData[streamOffset + 2] & 0xF);
var channelLayout = (TSChannelLayout)
(clipData[streamOffset + 2] >> 4);
var sampleRate = (TSSampleRate)
(clipData[streamOffset + 2] & 0xF);
stream = new TSAudioStream();
((TSAudioStream)stream).LanguageCode = languageCode;
((TSAudioStream)stream).ChannelLayout = channelLayout;
((TSAudioStream)stream).SampleRate = TSAudioStream.ConvertSampleRate(sampleRate);
((TSAudioStream)stream).LanguageCode = languageCode;
stream = new TSAudioStream();
((TSAudioStream)stream).LanguageCode = languageCode;
((TSAudioStream)stream).ChannelLayout = channelLayout;
((TSAudioStream)stream).SampleRate = TSAudioStream.ConvertSampleRate(sampleRate);
((TSAudioStream)stream).LanguageCode = languageCode;
#if DEBUG
Debug.WriteLine(string.Format(
"\t{0} {1} {2} {3} {4}",
@@ -188,20 +183,19 @@ namespace BDInfo
channelLayout,
sampleRate));
#endif
}
break;
}
break;
case TSStreamType.INTERACTIVE_GRAPHICS:
case TSStreamType.PRESENTATION_GRAPHICS:
{
byte[] languageBytes = new byte[3];
Array.Copy(clipData, streamOffset + 2,
languageBytes, 0, languageBytes.Length);
string languageCode =
_textEncoding.GetASCIIEncoding().GetString(languageBytes, 0, languageBytes.Length);
{
byte[] languageBytes = new byte[3];
Array.Copy(clipData, streamOffset + 2,
languageBytes, 0, languageBytes.Length);
string languageCode = Encoding.ASCII.GetString(languageBytes, 0, languageBytes.Length);
stream = new TSGraphicsStream();
stream.LanguageCode = languageCode;
stream.LanguageCode = languageCode;
#if DEBUG
Debug.WriteLine(string.Format(
"\t{0} {1} {2}",
@@ -209,16 +203,15 @@ namespace BDInfo
streamType,
languageCode));
#endif
}
break;
}
break;
case TSStreamType.SUBTITLE:
{
byte[] languageBytes = new byte[3];
Array.Copy(clipData, streamOffset + 3,
languageBytes, 0, languageBytes.Length);
string languageCode =
_textEncoding.GetASCIIEncoding().GetString(languageBytes, 0, languageBytes.Length);
{
byte[] languageBytes = new byte[3];
Array.Copy(clipData, streamOffset + 3,
languageBytes, 0, languageBytes.Length);
string languageCode = Encoding.ASCII.GetString(languageBytes, 0, languageBytes.Length);
#if DEBUG
Debug.WriteLine(string.Format(
"\t{0} {1} {2}",
@@ -227,9 +220,9 @@ namespace BDInfo
languageCode));
#endif
stream = new TSTextStream();
stream.LanguageCode = languageCode;
}
break;
stream.LanguageCode = languageCode;
}
break;
}
if (stream != null)
@@ -240,7 +233,7 @@ namespace BDInfo
}
streamOffset += clipData[streamOffset] + 1;
}
}
IsValid = true;
}
finally

View File

@@ -1,4 +1,4 @@
//============================================================================
//============================================================================
// BDInfo - Blu-ray Video and Audio Analysis Tool
// Copyright © 2010 Cinema Squid
//
@@ -283,7 +283,7 @@ namespace BDInfo
bool isAVC = false;
bool isMVC = false;
foreach (TSStream finishedStream in Streams.Values)
foreach (var finishedStream in Streams.Values)
{
if (!finishedStream.IsInitialized)
{
@@ -327,10 +327,10 @@ namespace BDInfo
UpdateStreamBitrate(PID, PTSPID, PTS, PTSDiff);
}
foreach (TSPlaylistFile playlist in Playlists)
foreach (var playlist in Playlists)
{
double packetSeconds = 0;
foreach (TSStreamClip clip in playlist.StreamClips)
foreach (var clip in playlist.StreamClips)
{
if (clip.AngleIndex == 0)
{
@@ -339,7 +339,7 @@ namespace BDInfo
}
if (packetSeconds > 0)
{
foreach (TSStream playlistStream in playlist.SortedStreams)
foreach (var playlistStream in playlist.SortedStreams)
{
if (playlistStream.IsVBR)
{
@@ -366,14 +366,14 @@ namespace BDInfo
{
if (Playlists == null) return;
TSStreamState streamState = StreamStates[PID];
var streamState = StreamStates[PID];
double streamTime = (double)PTS / 90000;
double streamInterval = (double)PTSDiff / 90000;
double streamOffset = streamTime + streamInterval;
foreach (TSPlaylistFile playlist in Playlists)
foreach (var playlist in Playlists)
{
foreach (TSStreamClip clip in playlist.StreamClips)
foreach (var clip in playlist.StreamClips)
{
if (clip.Name != this.Name) continue;
@@ -390,15 +390,15 @@ namespace BDInfo
clip.PacketSeconds = streamOffset - clip.TimeIn;
}
Dictionary<ushort, TSStream> playlistStreams = playlist.Streams;
if (clip.AngleIndex > 0 &&
var playlistStreams = playlist.Streams;
if (clip.AngleIndex > 0 &&
clip.AngleIndex < playlist.AngleStreams.Count + 1)
{
playlistStreams = playlist.AngleStreams[clip.AngleIndex - 1];
}
if (playlistStreams.ContainsKey(PID))
{
TSStream stream = playlistStreams[PID];
var stream = playlistStreams[PID];
stream.PayloadBytes += streamState.WindowBytes;
stream.PacketCount += streamState.WindowPackets;
@@ -425,13 +425,13 @@ namespace BDInfo
if (Streams.ContainsKey(PID))
{
TSStream stream = Streams[PID];
var stream = Streams[PID];
stream.PayloadBytes += streamState.WindowBytes;
stream.PacketCount += streamState.WindowPackets;
if (stream.IsVideoStream)
{
TSStreamDiagnostics diag = new TSStreamDiagnostics();
var diag = new TSStreamDiagnostics();
diag.Marker = (double)PTS / 90000;
diag.Interval = (double)PTSDiff / 90000;
diag.Bytes = streamState.WindowBytes;
@@ -457,7 +457,7 @@ namespace BDInfo
int dataSize = 16384;
Stream fileStream = null;
try
{
{
string fileName;
if (BDInfoSettings.EnableSSIF &&
InterleavedFile != null)
@@ -482,13 +482,13 @@ namespace BDInfo
StreamStates.Clear();
StreamDiagnostics.Clear();
TSPacketParser parser =
var parser =
new TSPacketParser();
long fileLength = (uint)fileStream.Length;
byte[] buffer = new byte[dataSize];
int bufferLength = 0;
while ((bufferLength =
while ((bufferLength =
fileStream.Read(buffer, 0, buffer.Length)) > 0)
{
int offset = 0;
@@ -536,80 +536,80 @@ namespace BDInfo
switch (parser.HeaderParse)
{
case 2:
{
parser.TransportErrorIndicator =
(byte)((buffer[i] >> 7) & 0x1);
parser.PayloadUnitStartIndicator =
(byte)((buffer[i] >> 6) & 0x1);
parser.TransportPriority =
(byte)((buffer[i] >> 5) & 0x1);
parser.PID =
(ushort)((buffer[i] & 0x1f) << 8);
}
break;
{
parser.TransportErrorIndicator =
(byte)((buffer[i] >> 7) & 0x1);
parser.PayloadUnitStartIndicator =
(byte)((buffer[i] >> 6) & 0x1);
parser.TransportPriority =
(byte)((buffer[i] >> 5) & 0x1);
parser.PID =
(ushort)((buffer[i] & 0x1f) << 8);
}
break;
case 1:
{
parser.PID |= (ushort)buffer[i];
if (Streams.ContainsKey(parser.PID))
{
parser.Stream = Streams[parser.PID];
parser.PID |= (ushort)buffer[i];
if (Streams.ContainsKey(parser.PID))
{
parser.Stream = Streams[parser.PID];
}
else
{
parser.Stream = null;
}
if (!StreamStates.ContainsKey(parser.PID))
{
StreamStates[parser.PID] = new TSStreamState();
}
parser.StreamState = StreamStates[parser.PID];
parser.StreamState.TotalPackets++;
parser.StreamState.WindowPackets++;
parser.TotalPackets++;
}
else
{
parser.Stream = null;
}
if (!StreamStates.ContainsKey(parser.PID))
{
StreamStates[parser.PID] = new TSStreamState();
}
parser.StreamState = StreamStates[parser.PID];
parser.StreamState.TotalPackets++;
parser.StreamState.WindowPackets++;
parser.TotalPackets++;
}
break;
break;
case 0:
{
parser.TransportScramblingControl =
(byte)((buffer[i] >> 6) & 0x3);
parser.AdaptionFieldControl =
(byte)((buffer[i] >> 4) & 0x3);
if ((parser.AdaptionFieldControl & 0x2) == 0x2)
{
parser.AdaptionFieldState = true;
}
if (parser.PayloadUnitStartIndicator == 1)
{
if (parser.PID == 0)
{
parser.PATSectionStart = true;
}
else if (parser.PID == parser.PMTPID)
{
parser.PMTSectionStart = true;
}
else if (parser.StreamState != null &&
parser.StreamState.TransferState)
{
parser.StreamState.TransferState = false;
parser.StreamState.TransferCount++;
parser.TransportScramblingControl =
(byte)((buffer[i] >> 6) & 0x3);
parser.AdaptionFieldControl =
(byte)((buffer[i] >> 4) & 0x3);
bool isFinished = ScanStream(
parser.Stream,
parser.StreamState,
parser.StreamState.StreamBuffer);
if (!isFullScan && isFinished)
if ((parser.AdaptionFieldControl & 0x2) == 0x2)
{
parser.AdaptionFieldState = true;
}
if (parser.PayloadUnitStartIndicator == 1)
{
if (parser.PID == 0)
{
return;
parser.PATSectionStart = true;
}
else if (parser.PID == parser.PMTPID)
{
parser.PMTSectionStart = true;
}
else if (parser.StreamState != null &&
parser.StreamState.TransferState)
{
parser.StreamState.TransferState = false;
parser.StreamState.TransferCount++;
bool isFinished = ScanStream(
parser.Stream,
parser.StreamState,
parser.StreamState.StreamBuffer);
if (!isFullScan && isFinished)
{
return;
}
}
}
}
}
break;
break;
}
}
else if (parser.AdaptionFieldState)
@@ -670,7 +670,8 @@ namespace BDInfo
parser.PAT[parser.PATOffset++] = buffer[i++];
parser.PATSectionLength--;
parser.PacketLength--;
} --i;
}
--i;
if (parser.PATSectionLength == 0)
{
@@ -680,10 +681,10 @@ namespace BDInfo
for (int k = 0; k < (parser.PATOffset - 4); k += 4)
{
uint programNumber = (uint)
((parser.PAT[k] << 8) +
((parser.PAT[k] << 8) +
parser.PAT[k + 1]);
ushort programPID = (ushort)
ushort programPID = (ushort)
(((parser.PAT[k + 2] & 0x1F) << 8) +
parser.PAT[k + 3]);
@@ -801,7 +802,8 @@ namespace BDInfo
PMT[parser.PMTOffset++] = buffer[i++];
--parser.PMTSectionLength;
--parser.PacketLength;
} --i;
}
--i;
if (parser.PMTSectionLength == 0)
{
@@ -837,7 +839,7 @@ namespace BDInfo
if (!Streams.ContainsKey(streamPID))
{
List<TSDescriptor> streamDescriptors =
var streamDescriptors =
new List<TSDescriptor>();
/*
@@ -985,7 +987,7 @@ namespace BDInfo
parser.PMTProgramDescriptorLength = buffer[i];
parser.PMTProgramDescriptors.Add(
new TSDescriptor(
parser.PMTProgramDescriptor,
parser.PMTProgramDescriptor,
parser.PMTProgramDescriptorLength));
break;
}
@@ -994,11 +996,11 @@ namespace BDInfo
{
--parser.PMTProgramDescriptorLength;
TSDescriptor descriptor = parser.PMTProgramDescriptors[
var descriptor = parser.PMTProgramDescriptors[
parser.PMTProgramDescriptors.Count - 1];
int valueIndex =
descriptor.Value.Length -
descriptor.Value.Length -
parser.PMTProgramDescriptorLength - 1;
descriptor.Value[valueIndex] = buffer[i];
@@ -1020,19 +1022,19 @@ namespace BDInfo
parser.SyncState = false;
}
}
else if (parser.Stream != null &&
parser.StreamState != null &&
else if (parser.Stream != null &&
parser.StreamState != null &&
parser.TransportScramblingControl == 0)
{
TSStream stream = parser.Stream;
TSStreamState streamState = parser.StreamState;
var stream = parser.Stream;
var streamState = parser.StreamState;
streamState.Parse =
(streamState.Parse << 8) + buffer[i];
if (streamState.TransferState)
{
if ((bufferLength - i) >= streamState.PacketLength &&
if ((bufferLength - i) >= streamState.PacketLength &&
streamState.PacketLength > 0)
{
offset = streamState.PacketLength;
@@ -1085,7 +1087,7 @@ namespace BDInfo
--parser.PacketLength;
bool headerFound = false;
if (stream.IsVideoStream &&
if (stream.IsVideoStream &&
streamState.Parse == 0x000001FD)
{
headerFound = true;
@@ -1170,18 +1172,18 @@ namespace BDInfo
(byte)(streamState.Parse & 0xFF);
#endif
break;
case 1:
streamState.PESHeaderFlags =
streamState.PESHeaderFlags =
(byte)(streamState.Parse & 0xFF);
#if DEBUG
streamState.PESHeader[streamState.PESHeaderIndex++] =
(byte)(streamState.Parse & 0xFF);
#endif
break;
case 0:
streamState.PESHeaderLength =
streamState.PESHeaderLength =
(byte)(streamState.Parse & 0xFF);
#if DEBUG
streamState.PESHeader[streamState.PESHeaderIndex++] =
@@ -1211,48 +1213,48 @@ namespace BDInfo
switch (streamState.PTSParse)
{
case 4:
streamState.PTSTemp =
streamState.PTSTemp =
((streamState.Parse & 0xE) << 29);
#if DEBUG
streamState.PESHeader[streamState.PESHeaderIndex++] =
streamState.PESHeader[streamState.PESHeaderIndex++] =
(byte)(streamState.Parse & 0xff);
#endif
break;
case 3:
streamState.PTSTemp |=
streamState.PTSTemp |=
((streamState.Parse & 0xFF) << 22);
#if DEBUG
streamState.PESHeader[streamState.PESHeaderIndex++] =
streamState.PESHeader[streamState.PESHeaderIndex++] =
(byte)(streamState.Parse & 0xFF);
#endif
break;
case 2:
streamState.PTSTemp |=
streamState.PTSTemp |=
((streamState.Parse & 0xFE) << 14);
#if DEBUG
streamState.PESHeader[streamState.PESHeaderIndex++] =
streamState.PESHeader[streamState.PESHeaderIndex++] =
(byte)(streamState.Parse & 0xFF);
#endif
break;
case 1:
streamState.PTSTemp |=
streamState.PTSTemp |=
((streamState.Parse & 0xFF) << 7);
#if DEBUG
streamState.PESHeader[streamState.PESHeaderIndex++] =
streamState.PESHeader[streamState.PESHeaderIndex++] =
(byte)(streamState.Parse & 0xFF);
#endif
break;
case 0:
streamState.PTSTemp |=
streamState.PTSTemp |=
((streamState.Parse & 0xFE) >> 1);
#if DEBUG
streamState.PESHeader[streamState.PESHeaderIndex++] =
streamState.PESHeader[streamState.PESHeaderIndex++] =
(byte)(streamState.Parse & 0xff);
#endif
#endif
streamState.PTS = streamState.PTSTemp;
if (streamState.PTS > streamState.PTSLast)
@@ -1260,13 +1262,13 @@ namespace BDInfo
if (streamState.PTSLast > 0)
{
streamState.PTSTransfer = (streamState.PTS - streamState.PTSLast);
}
}
streamState.PTSLast = streamState.PTS;
}
streamState.PTSDiff = streamState.PTS - streamState.DTSPrev;
if (streamState.PTSCount > 0 &&
if (streamState.PTSCount > 0 &&
stream.IsVideoStream)
{
UpdateStreamBitrates(stream.PID, streamState.PTS, streamState.PTSDiff);
@@ -1280,7 +1282,7 @@ namespace BDInfo
}
Length = (double)(parser.PTSLast - parser.PTSFirst) / 90000;
}
streamState.DTSPrev = streamState.PTS;
streamState.PTSCount++;
if (streamState.PESHeaderLength == 0)
@@ -1299,46 +1301,46 @@ namespace BDInfo
switch (streamState.DTSParse)
{
case 9:
streamState.PTSTemp =
streamState.PTSTemp =
((streamState.Parse & 0xE) << 29);
#if DEBUG
streamState.PESHeader[streamState.PESHeaderIndex++] =
streamState.PESHeader[streamState.PESHeaderIndex++] =
(byte)(streamState.Parse & 0xFF);
#endif
break;
case 8:
streamState.PTSTemp |=
streamState.PTSTemp |=
((streamState.Parse & 0xFF) << 22);
#if DEBUG
streamState.PESHeader[streamState.PESHeaderIndex++] =
streamState.PESHeader[streamState.PESHeaderIndex++] =
(byte)(streamState.Parse & 0xFF);
#endif
break;
case 7:
streamState.PTSTemp |=
streamState.PTSTemp |=
((streamState.Parse & 0xFE) << 14);
#if DEBUG
streamState.PESHeader[streamState.PESHeaderIndex++] =
streamState.PESHeader[streamState.PESHeaderIndex++] =
(byte)(streamState.Parse & 0xff);
#endif
break;
case 6:
streamState.PTSTemp |=
streamState.PTSTemp |=
((streamState.Parse & 0xFF) << 7);
#if DEBUG
streamState.PESHeader[streamState.PESHeaderIndex++] =
streamState.PESHeader[streamState.PESHeaderIndex++] =
(byte)(streamState.Parse & 0xFF);
#endif
break;
case 5:
streamState.PTSTemp |=
streamState.PTSTemp |=
((streamState.Parse & 0xFE) >> 1);
#if DEBUG
streamState.PESHeader[streamState.PESHeaderIndex++] =
streamState.PESHeader[streamState.PESHeaderIndex++] =
(byte)(streamState.Parse & 0xff);
#endif
streamState.PTS = streamState.PTSTemp;
@@ -1347,48 +1349,48 @@ namespace BDInfo
streamState.PTSLast = streamState.PTS;
}
break;
case 4:
streamState.DTSTemp =
streamState.DTSTemp =
((streamState.Parse & 0xE) << 29);
#if DEBUG
streamState.PESHeader[streamState.PESHeaderIndex++] =
streamState.PESHeader[streamState.PESHeaderIndex++] =
(byte)(streamState.Parse & 0xff);
#endif
break;
case 3:
streamState.DTSTemp |=
streamState.DTSTemp |=
((streamState.Parse & 0xFF) << 22);
#if DEBUG
streamState.PESHeader[streamState.PESHeaderIndex++] =
streamState.PESHeader[streamState.PESHeaderIndex++] =
(byte)(streamState.Parse & 0xff);
#endif
break;
case 2:
streamState.DTSTemp |=
streamState.DTSTemp |=
((streamState.Parse & 0xFE) << 14);
#if DEBUG
streamState.PESHeader[streamState.PESHeaderIndex++] =
streamState.PESHeader[streamState.PESHeaderIndex++] =
(byte)(streamState.Parse & 0xff);
#endif
break;
case 1:
streamState.DTSTemp |=
streamState.DTSTemp |=
((streamState.Parse & 0xFF) << 7);
#if DEBUG
streamState.PESHeader[streamState.PESHeaderIndex++] =
streamState.PESHeader[streamState.PESHeaderIndex++] =
(byte)(streamState.Parse & 0xFF);
#endif
break;
case 0:
streamState.DTSTemp |=
streamState.DTSTemp |=
((streamState.Parse & 0xFE) >> 1);
#if DEBUG
streamState.PESHeader[streamState.PESHeaderIndex++] =
streamState.PESHeader[streamState.PESHeaderIndex++] =
(byte)(streamState.Parse & 0xff);
#endif
streamState.PTSDiff = streamState.DTSTemp - streamState.DTSPrev;
@@ -1459,7 +1461,7 @@ namespace BDInfo
ulong PTSLast = 0;
ulong PTSDiff = 0;
foreach (TSStream stream in Streams.Values)
foreach (var stream in Streams.Values)
{
if (!stream.IsVideoStream) continue;
@@ -1482,8 +1484,8 @@ namespace BDInfo
}
private TSStream CreateStream(
ushort streamPID,
byte streamType,
ushort streamPID,
byte streamType,
List<TSDescriptor> streamDescriptors)
{
TSStream stream = null;
@@ -1495,10 +1497,10 @@ namespace BDInfo
case TSStreamType.MPEG1_VIDEO:
case TSStreamType.MPEG2_VIDEO:
case TSStreamType.VC1_VIDEO:
{
stream = new TSVideoStream();
}
break;
{
stream = new TSVideoStream();
}
break;
case TSStreamType.AC3_AUDIO:
case TSStreamType.AC3_PLUS_AUDIO:
@@ -1511,23 +1513,23 @@ namespace BDInfo
case TSStreamType.LPCM_AUDIO:
case TSStreamType.MPEG1_AUDIO:
case TSStreamType.MPEG2_AUDIO:
{
stream = new TSAudioStream();
}
break;
{
stream = new TSAudioStream();
}
break;
case TSStreamType.INTERACTIVE_GRAPHICS:
case TSStreamType.PRESENTATION_GRAPHICS:
{
stream = new TSGraphicsStream();
}
break;
{
stream = new TSGraphicsStream();
}
break;
case TSStreamType.SUBTITLE:
{
stream = new TSTextStream();
}
break;
{
stream = new TSTextStream();
}
break;
default:
break;
@@ -1548,6 +1550,6 @@ namespace BDInfo
}
return stream;
}
}
}
}

View File

@@ -11,6 +11,14 @@
- [AnthonyLavado](https://github.com/anthonylavado)
- [sparky8251](https://github.com/sparky8251)
- [LeoVerto](https://github.com/LeoVerto)
- [grafixeyehero](https://github.com/grafixeyehero)
- [cvium](https://github.com/cvium)
- [wtayl0r](https://github.com/wtayl0r)
- [TtheCreator](https://github.com/Tthecreator)
- [dkanada](https://github.com/dkanada)
- [LogicalPhallacy](https://github.com/LogicalPhallacy/)
- [RazeLighter777](https://github.com/RazeLighter777)
- [WillWill56](https://github.com/WillWill56)
# Emby Contributors

View File

@@ -1,28 +1,25 @@
ARG DOTNET_VERSION=2
# Download ffmpeg first to allow quicker rebuild of other layers
FROM alpine as ffmpeg
ARG FFMPEG_URL=https://www.johnvansickle.com/ffmpeg/old-releases/ffmpeg-4.0.3-64bit-static.tar.xz
RUN wget ${FFMPEG_URL} -O - | tar Jxf - \
&& mkdir ffmpeg-bin \
&& mv ffmpeg*/ffmpeg ffmpeg-bin \
&& mv ffmpeg*/ffprobe ffmpeg-bin
FROM microsoft/dotnet:${DOTNET_VERSION}-sdk as builder
WORKDIR /repo
COPY . .
RUN export DOTNET_CLI_TELEMETRY_OPTOUT=1 \
&& dotnet clean \
&& dotnet publish --configuration release --output /jellyfin
ENV DOTNET_CLI_TELEMETRY_OPTOUT=1
RUN dotnet publish \
--configuration release \
--output /jellyfin \
Jellyfin.Server
FROM jrottenberg/ffmpeg:4.0-vaapi as ffmpeg
FROM microsoft/dotnet:${DOTNET_VERSION}-runtime
# libfontconfig1 is required for Skia
RUN apt-get update \
&& apt-get install --no-install-recommends --no-install-suggests -y \
libfontconfig1 \
&& apt-get clean autoclean \
&& apt-get autoremove \
&& rm -rf /var/lib/{apt,dpkg,cache,log}
COPY --from=ffmpeg / /
COPY --from=builder /jellyfin /jellyfin
COPY --from=ffmpeg /ffmpeg-bin/* /usr/bin/
EXPOSE 8096
VOLUME /config /media
RUN apt update \
&& apt install -y libfontconfig1 # needed for Skia
ENTRYPOINT dotnet /jellyfin/jellyfin.dll -programdata /config
ENTRYPOINT dotnet /jellyfin/jellyfin.dll --datadir /config

View File

@@ -1,17 +0,0 @@
ARG DOTNET_VERSION=3.0
FROM microsoft/dotnet:${DOTNET_VERSION}-sdk as builder
WORKDIR /repo
COPY . .
RUN export DOTNET_CLI_TELEMETRY_OPTOUT=1 \
&& find . -type f -exec sed -i 's/netcoreapp2.1/netcoreapp3.0/g' {} \; \
&& dotnet clean \
&& dotnet publish --configuration release --output /jellyfin
FROM microsoft/dotnet:${DOTNET_VERSION}-runtime
COPY --from=builder /jellyfin /jellyfin
EXPOSE 8096
RUN apt update \
&& apt install -y ffmpeg
VOLUME /config /media
ENTRYPOINT dotnet /jellyfin/jellyfin.dll -programdata /config

34
Dockerfile.arm Normal file
View File

@@ -0,0 +1,34 @@
# Requires binfm_misc registration
# https://github.com/multiarch/qemu-user-static#binfmt_misc-register
ARG DOTNET_VERSION=3.0
FROM multiarch/qemu-user-static:x86_64-arm as qemu
FROM alpine as qemu_extract
COPY --from=qemu /usr/bin qemu-arm-static.tar.gz
RUN tar -xzvf qemu-arm-static.tar.gz
FROM microsoft/dotnet:${DOTNET_VERSION}-sdk-stretch as builder
WORKDIR /repo
COPY . .
ENV DOTNET_CLI_TELEMETRY_OPTOUT=1
# TODO Remove or update the sed line when we update dotnet version.
RUN find . -type f -exec sed -i 's/netcoreapp2.1/netcoreapp3.0/g' {} \;
# Discard objs - may cause failures if exists
RUN find . -type d -name obj | xargs -r rm -r
# Build
RUN dotnet publish \
-r linux-arm \
--configuration release \
--output /jellyfin \
Jellyfin.Server
FROM microsoft/dotnet:${DOTNET_VERSION}-runtime-stretch-slim-arm32v7
COPY --from=qemu_extract qemu-arm-static /usr/bin
RUN apt-get update \
&& apt-get install --no-install-recommends --no-install-suggests -y ffmpeg
COPY --from=builder /jellyfin /jellyfin
EXPOSE 8096
VOLUME /config /media
ENTRYPOINT dotnet /jellyfin/jellyfin.dll --datadir /config

35
Dockerfile.arm64 Normal file
View File

@@ -0,0 +1,35 @@
# Requires binfm_misc registration
# https://github.com/multiarch/qemu-user-static#binfmt_misc-register
ARG DOTNET_VERSION=3.0
FROM multiarch/qemu-user-static:x86_64-aarch64 as qemu
FROM alpine as qemu_extract
COPY --from=qemu /usr/bin qemu-aarch64-static.tar.gz
RUN tar -xzvf qemu-aarch64-static.tar.gz
FROM microsoft/dotnet:${DOTNET_VERSION}-sdk-stretch as builder
WORKDIR /repo
COPY . .
ENV DOTNET_CLI_TELEMETRY_OPTOUT=1
# TODO Remove or update the sed line when we update dotnet version.
RUN find . -type f -exec sed -i 's/netcoreapp2.1/netcoreapp3.0/g' {} \;
# Discard objs - may cause failures if exists
RUN find . -type d -name obj | xargs -r rm -r
# Build
RUN dotnet publish \
-r linux-arm64 \
--configuration release \
--output /jellyfin \
Jellyfin.Server
FROM microsoft/dotnet:${DOTNET_VERSION}-runtime-stretch-slim-arm64v8
COPY --from=qemu_extract qemu-aarch64-static /usr/bin
RUN apt-get update \
&& apt-get install --no-install-recommends --no-install-suggests -y ffmpeg
COPY --from=builder /jellyfin /jellyfin
EXPOSE 8096
VOLUME /config /media
ENTRYPOINT dotnet /jellyfin/jellyfin.dll --datadir /config

View File

@@ -1,22 +0,0 @@
FROM debian:9
# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current
RUN apt-get update \
&& apt-get install -y apt-transport-https debhelper gnupg wget devscripts \
&& wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.asc.gpg \
&& mv microsoft.asc.gpg /etc/apt/trusted.gpg.d/ \
&& wget -q https://packages.microsoft.com/config/debian/9/prod.list \
&& mv prod.list /etc/apt/sources.list.d/microsoft-prod.list \
&& chown root:root /etc/apt/trusted.gpg.d/microsoft.asc.gpg \
&& chown root:root /etc/apt/sources.list.d/microsoft-prod.list \
&& apt-get update
WORKDIR /repo
COPY . .
RUN yes|mk-build-deps -i \
&& dpkg-buildpackage -us -uc \
&& mkdir /dist \
&& mv /jellyfin*deb /dist
WORKDIR /dist

View File

@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System;
using System.IO;
namespace DvdLib

View File

@@ -1,4 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<ItemGroup>
<Compile Include="..\SharedVersion.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MediaBrowser.Model\MediaBrowser.Model.csproj" />

View File

@@ -1,8 +1,3 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DvdLib.Ifo
{
public enum AudioCodec

View File

@@ -1,7 +1,3 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace DvdLib.Ifo

View File

@@ -1,7 +1,3 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace DvdLib.Ifo

View File

@@ -1,7 +1,3 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace DvdLib.Ifo

View File

@@ -1,8 +1,3 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DvdLib.Ifo
{
public class Chapter

View File

@@ -1,9 +1,7 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Diagnostics;
using System.Linq;
using MediaBrowser.Model.IO;
namespace DvdLib.Ifo
@@ -33,10 +31,9 @@ namespace DvdLib.Ifo
foreach (var ifo in allIfos)
{
var num = ifo.Name.Split('_').ElementAtOrDefault(1);
ushort ifoNumber;
var numbersRead = new List<ushort>();
if (!string.IsNullOrEmpty(num) && ushort.TryParse(num, out ifoNumber) && !numbersRead.Contains(ifoNumber))
if (!string.IsNullOrEmpty(num) && ushort.TryParse(num, out var ifoNumber) && !numbersRead.Contains(ifoNumber))
{
ReadVTS(ifoNumber, ifo.FullName);
numbersRead.Add(ifoNumber);
@@ -47,7 +44,7 @@ namespace DvdLib.Ifo
{
using (var vmgFs = _fileSystem.GetFileStream(vmgPath.FullName, FileOpenMode.Open, FileAccessMode.Read, FileShareMode.Read))
{
using (BigEndianBinaryReader vmgRead = new BigEndianBinaryReader(vmgFs))
using (var vmgRead = new BigEndianBinaryReader(vmgFs))
{
vmgFs.Seek(0x3E, SeekOrigin.Begin);
_titleSetCount = vmgRead.ReadUInt16();
@@ -73,7 +70,7 @@ namespace DvdLib.Ifo
read.BaseStream.Seek(6, SeekOrigin.Current);
for (uint titleNum = 1; titleNum <= _titleCount; titleNum++)
{
Title t = new Title(titleNum);
var t = new Title(titleNum);
t.ParseTT_SRPT(read);
Titles.Add(t);
}
@@ -81,7 +78,7 @@ namespace DvdLib.Ifo
private void ReadVTS(ushort vtsNum, List<FileSystemMetadata> allFiles)
{
var filename = String.Format("VTS_{0:00}_0.IFO", vtsNum);
var filename = string.Format("VTS_{0:00}_0.IFO", vtsNum);
var vtsPath = allFiles.FirstOrDefault(i => string.Equals(i.Name, filename, StringComparison.OrdinalIgnoreCase)) ??
allFiles.FirstOrDefault(i => string.Equals(i.Name, Path.ChangeExtension(filename, ".bup"), StringComparison.OrdinalIgnoreCase));
@@ -100,7 +97,7 @@ namespace DvdLib.Ifo
using (var vtsFs = _fileSystem.GetFileStream(vtsPath, FileOpenMode.Open, FileAccessMode.Read, FileShareMode.Read))
{
using (BigEndianBinaryReader vtsRead = new BigEndianBinaryReader(vtsFs))
using (var vtsRead = new BigEndianBinaryReader(vtsFs))
{
// Read VTS_PTT_SRPT
vtsFs.Seek(0xC8, SeekOrigin.Begin);
@@ -121,7 +118,7 @@ namespace DvdLib.Ifo
{
uint chapNum = 1;
vtsFs.Seek(baseAddr + offsets[titleNum], SeekOrigin.Begin);
Title t = Titles.FirstOrDefault(vtst => vtst.IsVTSTitle(vtsNum, titleNum + 1));
var t = Titles.FirstOrDefault(vtst => vtst.IsVTSTitle(vtsNum, titleNum + 1));
if (t == null) continue;
do
@@ -151,11 +148,11 @@ namespace DvdLib.Ifo
vtsFs.Seek(3, SeekOrigin.Current);
uint vtsPgcOffset = vtsRead.ReadUInt32();
Title t = Titles.FirstOrDefault(vtst => vtst.IsVTSTitle(vtsNum, titleNum));
var t = Titles.FirstOrDefault(vtst => vtst.IsVTSTitle(vtsNum, titleNum));
if (t != null) t.AddPgc(vtsRead, startByte + vtsPgcOffset, entryPgc, pgcNum);
}
}
}
}
}
}
}

View File

@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System;
namespace DvdLib.Ifo
{
@@ -20,7 +17,7 @@ namespace DvdLib.Ifo
else if ((data[3] & 0x40) != 0) FrameRate = 25;
}
private byte GetBCDValue(byte data)
private static byte GetBCDValue(byte data)
{
return (byte)((((data & 0xF0) >> 4) * 10) + (data & 0x0F));
}

View File

@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DvdLib.Ifo
{

View File

@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DvdLib.Ifo
{

View File

@@ -1,8 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Linq;
namespace DvdLib.Ifo
{
@@ -68,7 +66,7 @@ namespace DvdLib.Ifo
ProhibitedUserOperations = (UserOperation)br.ReadUInt32();
AudioStreamControl = br.ReadBytes(16);
SubpictureStreamControl = br.ReadBytes(128);
_nextProgramNumber = br.ReadUInt16();
_prevProgramNumber = br.ReadUInt16();
_goupProgramNumber = br.ReadUInt16();
@@ -89,7 +87,7 @@ namespace DvdLib.Ifo
br.BaseStream.Seek(startPos + _cellPositionOffset, SeekOrigin.Begin);
for (int cellNum = 0; cellNum < _cellCount; cellNum++)
{
Cell c = new Cell();
var c = new Cell();
c.ParsePosition(br);
Cells.Add(c);
}
@@ -101,12 +99,12 @@ namespace DvdLib.Ifo
}
br.BaseStream.Seek(startPos + _programMapOffset, SeekOrigin.Begin);
List<int> cellNumbers = new List<int>();
var cellNumbers = new List<int>();
for (int progNum = 0; progNum < _programCount; progNum++) cellNumbers.Add(br.ReadByte() - 1);
for (int i = 0; i < cellNumbers.Count; i++)
{
int max = (i + 1 == cellNumbers.Count) ? _cellCount : cellNumbers[i+1];
int max = (i + 1 == cellNumbers.Count) ? _cellCount : cellNumbers[i + 1];
Programs.Add(new Program(Cells.Where((c, idx) => idx >= cellNumbers[i] && idx < max).ToList()));
}
}

View File

@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace DvdLib.Ifo
@@ -20,7 +17,7 @@ namespace DvdLib.Ifo
public ProgramChain EntryProgramChain { get; private set; }
public readonly List<ProgramChain> ProgramChains;
public readonly List<Chapter> Chapters;
public readonly List<Chapter> Chapters;
public Title(uint titleNum)
{
@@ -53,7 +50,7 @@ namespace DvdLib.Ifo
long curPos = br.BaseStream.Position;
br.BaseStream.Seek(startByte, SeekOrigin.Begin);
ProgramChain pgc = new ProgramChain(pgcNum);
var pgc = new ProgramChain(pgcNum);
pgc.ParseHeader(br);
ProgramChains.Add(pgc);
if (entryPgc) EntryProgramChain = pgc;

View File

@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System;
namespace DvdLib.Ifo
{

View File

@@ -1,8 +1,3 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DvdLib.Ifo
{
public enum VideoCodec

View File

@@ -1,29 +1,21 @@
using System.Resources;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Resources;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("DvdLib")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DvdLib")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyCompany("Jellyfin Project")]
[assembly: AssemblyProduct("Jellyfin: The Free Software Media System")]
[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License Version 2")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.1")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

View File

@@ -1,14 +1,14 @@
using MediaBrowser.Controller.Dlna;
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using MediaBrowser.Model.Services;
using MediaBrowser.Common.Extensions;
using System.Text;
using MediaBrowser.Controller.Net;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Emby.Dlna.Main;
using MediaBrowser.Common.Extensions;
using MediaBrowser.Controller.Dlna;
using MediaBrowser.Controller.Net;
using MediaBrowser.Model.Services;
namespace Emby.Dlna.Api
{
@@ -115,29 +115,11 @@ namespace Emby.Dlna.Api
public IRequest Request { get; set; }
private IHttpResultFactory _resultFactory;
private IContentDirectory ContentDirectory
{
get
{
return DlnaEntryPoint.Current.ContentDirectory;
}
}
private IContentDirectory ContentDirectory => DlnaEntryPoint.Current.ContentDirectory;
private IConnectionManager ConnectionManager
{
get
{
return DlnaEntryPoint.Current.ConnectionManager;
}
}
private IConnectionManager ConnectionManager => DlnaEntryPoint.Current.ConnectionManager;
private IMediaReceiverRegistrar MediaReceiverRegistrar
{
get
{
return DlnaEntryPoint.Current.MediaReceiverRegistrar;
}
}
private IMediaReceiverRegistrar MediaReceiverRegistrar => DlnaEntryPoint.Current.MediaReceiverRegistrar;
public DlnaServerService(IDlnaManager dlnaManager, IHttpResultFactory httpResultFactory)
{
@@ -227,7 +209,7 @@ namespace Emby.Dlna.Api
// TODO: Work out what this is doing.
if (string.Equals(first, "mediabrowser", StringComparison.OrdinalIgnoreCase) ||
string.Equals(first, "emby", StringComparison.OrdinalIgnoreCase) ||
string.Equals(first, "jellyfin", StringComparison.OrdinalIgnoreCase ))
string.Equals(first, "jellyfin", StringComparison.OrdinalIgnoreCase))
{
index++;
}
@@ -254,12 +236,14 @@ namespace Emby.Dlna.Api
public object Get(GetIcon request)
{
var contentType = "image/" + Path.GetExtension(request.Filename).TrimStart('.').ToLower();
var contentType = "image/" + Path.GetExtension(request.Filename)
.TrimStart('.')
.ToLowerInvariant();
var cacheLength = TimeSpan.FromDays(365);
var cacheKey = Request.RawUrl.GetMD5();
return _resultFactory.GetStaticResult(Request, cacheKey, null, cacheLength, contentType, () => Task.FromResult<Stream>(_dlnaManager.GetIcon(request.Filename).Stream));
return _resultFactory.GetStaticResult(Request, cacheKey, null, cacheLength, contentType, () => Task.FromResult(_dlnaManager.GetIcon(request.Filename).Stream));
}
public object Subscribe(ProcessContentDirectoryEventRequest request)

View File

@@ -1,4 +1,4 @@
using System.Linq;
using System.Linq;
using MediaBrowser.Controller.Dlna;
using MediaBrowser.Controller.Net;
using MediaBrowser.Model.Dlna;
@@ -80,4 +80,4 @@ namespace Emby.Dlna.Api
_dlnaManager.CreateProfile(request);
}
}
}
}

View File

@@ -1,12 +1,12 @@

namespace Emby.Dlna.Common
{
{
public class Argument
{
public string Name { get; set; }
public string Name { get; set; }
public string Direction { get; set; }
public string Direction { get; set; }
public string RelatedStateVariable { get; set; }
public string RelatedStateVariable { get; set; }
}
}

View File

@@ -1,4 +1,4 @@

namespace Emby.Dlna.Common
{
public class DeviceIcon

View File

@@ -1,4 +1,4 @@

namespace Emby.Dlna.Common
{
public class DeviceService

View File

@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
namespace Emby.Dlna.Common
{

View File

@@ -1,4 +1,3 @@
using System.Collections.Generic;
using System;
namespace Emby.Dlna.Common

View File

@@ -1,4 +1,4 @@

namespace Emby.Dlna.Configuration
{
public class DlnaOptions

View File

@@ -1,6 +1,6 @@
using MediaBrowser.Common.Configuration;
using Emby.Dlna.Configuration;
using System.Collections.Generic;
using Emby.Dlna.Configuration;
using MediaBrowser.Common.Configuration;
namespace Emby.Dlna
{

View File

@@ -1,8 +1,8 @@
using MediaBrowser.Common.Net;
using System.Collections.Generic;
using Emby.Dlna.Service;
using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Dlna;
using Emby.Dlna.Service;
using System.Collections.Generic;
using MediaBrowser.Model.Xml;
using Microsoft.Extensions.Logging;

View File

@@ -1,6 +1,6 @@
using Emby.Dlna.Common;
using Emby.Dlna.Service;
using System.Collections.Generic;
using Emby.Dlna.Common;
using Emby.Dlna.Service;
namespace Emby.Dlna.ConnectionManager
{
@@ -11,7 +11,7 @@ namespace Emby.Dlna.ConnectionManager
return new ServiceXmlBuilder().GetXml(new ServiceActionListBuilder().GetActions(), GetStateVariables());
}
private IEnumerable<StateVariable> GetStateVariables()
private static IEnumerable<StateVariable> GetStateVariables()
{
var list = new List<StateVariable>();

View File

@@ -1,12 +1,11 @@
using MediaBrowser.Common.Extensions;
using MediaBrowser.Controller.Configuration;
using Emby.Dlna.Server;
using Emby.Dlna.Service;
using MediaBrowser.Model.Dlna;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using Emby.Dlna.Service;
using MediaBrowser.Common.Extensions;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Xml;
using Microsoft.Extensions.Logging;
namespace Emby.Dlna.ConnectionManager
{

View File

@@ -1,5 +1,5 @@
using Emby.Dlna.Common;
using System.Collections.Generic;
using Emby.Dlna.Common;
namespace Emby.Dlna.ConnectionManager
{
@@ -19,7 +19,7 @@ namespace Emby.Dlna.ConnectionManager
return list;
}
private ServiceAction PrepareForConnection()
private static ServiceAction PrepareForConnection()
{
var action = new ServiceAction
{
@@ -77,8 +77,8 @@ namespace Emby.Dlna.ConnectionManager
return action;
}
private ServiceAction GetCurrentConnectionInfo()
private static ServiceAction GetCurrentConnectionInfo()
{
var action = new ServiceAction
{

View File

@@ -1,18 +1,18 @@
using MediaBrowser.Common.Net;
using System;
using System.Collections.Generic;
using Emby.Dlna.Service;
using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Dlna;
using MediaBrowser.Controller.Drawing;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
using Emby.Dlna.Service;
using MediaBrowser.Model.Dlna;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using MediaBrowser.Controller.MediaEncoding;
using MediaBrowser.Controller.TV;
using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Globalization;
using MediaBrowser.Model.Xml;
using Microsoft.Extensions.Logging;
namespace Emby.Dlna.ContentDirectory
{
@@ -76,7 +76,6 @@ namespace Emby.Dlna.ContentDirectory
_dlna.GetDefaultProfile();
var serverAddress = request.RequestedUrl.Substring(0, request.RequestedUrl.IndexOf("/dlna", StringComparison.OrdinalIgnoreCase));
string accessToken = null;
var user = GetUser(profile);
@@ -85,7 +84,7 @@ namespace Emby.Dlna.ContentDirectory
_libraryManager,
profile,
serverAddress,
accessToken,
null,
_imageProcessor,
_userDataManager,
user,

View File

@@ -1,6 +1,6 @@
using Emby.Dlna.Common;
using Emby.Dlna.Service;
using System.Collections.Generic;
using Emby.Dlna.Common;
using Emby.Dlna.Service;
namespace Emby.Dlna.ContentDirectory
{
@@ -8,11 +8,11 @@ namespace Emby.Dlna.ContentDirectory
{
public string GetXml()
{
return new ServiceXmlBuilder().GetXml(new ServiceActionListBuilder().GetActions(),
return new ServiceXmlBuilder().GetXml(new ServiceActionListBuilder().GetActions(),
GetStateVariables());
}
private IEnumerable<StateVariable> GetStateVariables()
private static IEnumerable<StateVariable> GetStateVariables()
{
var list = new List<StateVariable>();

View File

@@ -1,19 +1,3 @@
using MediaBrowser.Common.Extensions;
using MediaBrowser.Controller.Channels;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Drawing;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Movies;
using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Controller.Library;
using Emby.Dlna.Didl;
using Emby.Dlna.Server;
using Emby.Dlna.Service;
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Entities;
using Microsoft.Extensions.Logging;
using MediaBrowser.Model.Querying;
using System;
using System.Collections.Generic;
using System.Globalization;
@@ -21,17 +5,28 @@ using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Xml;
using Emby.Dlna.Didl;
using Emby.Dlna.Service;
using MediaBrowser.Common.Extensions;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Drawing;
using MediaBrowser.Controller.Dto;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Audio;
using MediaBrowser.Controller.Entities.Movies;
using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.LiveTv;
using MediaBrowser.Controller.MediaEncoding;
using MediaBrowser.Controller.Playlists;
using MediaBrowser.Controller.TV;
using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Globalization;
using MediaBrowser.Model.Querying;
using MediaBrowser.Model.Xml;
using MediaBrowser.Model.Extensions;
using MediaBrowser.Controller.LiveTv;
using Microsoft.Extensions.Logging;
namespace Emby.Dlna.ContentDirectory
{
@@ -68,7 +63,7 @@ namespace Emby.Dlna.ContentDirectory
_profile = profile;
_config = config;
_didlBuilder = new DidlBuilder(profile, user, imageProcessor, serverAddress, accessToken, userDataManager, localization, mediaSourceManager, _logger, libraryManager, mediaEncoder);
_didlBuilder = new DidlBuilder(profile, user, imageProcessor, serverAddress, accessToken, userDataManager, localization, mediaSourceManager, _logger, mediaEncoder);
}
protected override IEnumerable<KeyValuePair<string, string>> GetResult(string methodName, IDictionary<string, string> methodParams)
@@ -197,9 +192,7 @@ namespace Emby.Dlna.ContentDirectory
public string GetValueOrDefault(IDictionary<string, string> sparams, string key, string defaultValue)
{
string val;
if (sparams.TryGetValue(key, out val))
if (sparams.TryGetValue(key, out string val))
{
return val;
}
@@ -221,14 +214,12 @@ namespace Emby.Dlna.ContentDirectory
int? requestedCount = null;
int? start = 0;
int requestedVal;
if (sparams.ContainsKey("RequestedCount") && int.TryParse(sparams["RequestedCount"], out requestedVal) && requestedVal > 0)
if (sparams.ContainsKey("RequestedCount") && int.TryParse(sparams["RequestedCount"], out var requestedVal) && requestedVal > 0)
{
requestedCount = requestedVal;
}
int startVal;
if (sparams.ContainsKey("StartingIndex") && int.TryParse(sparams["StartingIndex"], out startVal) && startVal > 0)
if (sparams.ContainsKey("StartingIndex") && int.TryParse(sparams["StartingIndex"], out var startVal) && startVal > 0)
{
start = startVal;
}
@@ -247,7 +238,7 @@ namespace Emby.Dlna.ContentDirectory
var dlnaOptions = _config.GetDlnaConfiguration();
using (XmlWriter writer = XmlWriter.Create(builder, settings))
using (var writer = XmlWriter.Create(builder, settings))
{
//writer.WriteStartDocument();
@@ -311,7 +302,7 @@ namespace Emby.Dlna.ContentDirectory
var resXML = builder.ToString();
return new []
return new[]
{
new KeyValuePair<string,string>("Result", resXML),
new KeyValuePair<string,string>("NumberReturned", provided.ToString(_usCulture)),
@@ -339,14 +330,12 @@ namespace Emby.Dlna.ContentDirectory
int? requestedCount = null;
int? start = 0;
int requestedVal;
if (sparams.ContainsKey("RequestedCount") && int.TryParse(sparams["RequestedCount"], out requestedVal) && requestedVal > 0)
if (sparams.ContainsKey("RequestedCount") && int.TryParse(sparams["RequestedCount"], out var requestedVal) && requestedVal > 0)
{
requestedCount = requestedVal;
}
int startVal;
if (sparams.ContainsKey("StartingIndex") && int.TryParse(sparams["StartingIndex"], out startVal) && startVal > 0)
if (sparams.ContainsKey("StartingIndex") && int.TryParse(sparams["StartingIndex"], out var startVal) && startVal > 0)
{
start = startVal;
}
@@ -363,7 +352,7 @@ namespace Emby.Dlna.ContentDirectory
int totalCount = 0;
int provided = 0;
using (XmlWriter writer = XmlWriter.Create(builder, settings))
using (var writer = XmlWriter.Create(builder, settings))
{
//writer.WriteStartDocument();
@@ -465,7 +454,7 @@ namespace Emby.Dlna.ContentDirectory
User = user,
Recursive = true,
IsMissing = false,
ExcludeItemTypes = new[] { typeof(Game).Name, typeof(Book).Name },
ExcludeItemTypes = new[] { typeof(Book).Name },
IsFolder = isFolder,
MediaTypes = mediaTypes.ToArray(),
DtoOptions = GetDtoOptions()
@@ -494,27 +483,26 @@ namespace Emby.Dlna.ContentDirectory
return GetGenreItems(item, Guid.Empty, user, sort, startIndex, limit);
}
if (!stubType.HasValue || stubType.Value != StubType.Folder)
if ((!stubType.HasValue || stubType.Value != StubType.Folder)
&& item is IHasCollectionType collectionFolder)
{
var collectionFolder = item as IHasCollectionType;
if (collectionFolder != null && string.Equals(CollectionType.Music, collectionFolder.CollectionType, StringComparison.OrdinalIgnoreCase))
if (string.Equals(CollectionType.Music, collectionFolder.CollectionType, StringComparison.OrdinalIgnoreCase))
{
return GetMusicFolders(item, user, stubType, sort, startIndex, limit);
}
if (collectionFolder != null && string.Equals(CollectionType.Movies, collectionFolder.CollectionType, StringComparison.OrdinalIgnoreCase))
else if (string.Equals(CollectionType.Movies, collectionFolder.CollectionType, StringComparison.OrdinalIgnoreCase))
{
return GetMovieFolders(item, user, stubType, sort, startIndex, limit);
}
if (collectionFolder != null && string.Equals(CollectionType.TvShows, collectionFolder.CollectionType, StringComparison.OrdinalIgnoreCase))
else if (string.Equals(CollectionType.TvShows, collectionFolder.CollectionType, StringComparison.OrdinalIgnoreCase))
{
return GetTvFolders(item, user, stubType, sort, startIndex, limit);
}
if (collectionFolder != null && string.Equals(CollectionType.Folders, collectionFolder.CollectionType, StringComparison.OrdinalIgnoreCase))
else if (string.Equals(CollectionType.Folders, collectionFolder.CollectionType, StringComparison.OrdinalIgnoreCase))
{
return GetFolders(item, user, stubType, sort, startIndex, limit);
}
if (collectionFolder != null && string.Equals(CollectionType.LiveTv, collectionFolder.CollectionType, StringComparison.OrdinalIgnoreCase))
else if (string.Equals(CollectionType.LiveTv, collectionFolder.CollectionType, StringComparison.OrdinalIgnoreCase))
{
return GetLiveTvChannels(item, user, stubType, sort, startIndex, limit);
}
@@ -535,7 +523,7 @@ namespace Emby.Dlna.ContentDirectory
Limit = limit,
StartIndex = startIndex,
IsVirtualItem = false,
ExcludeItemTypes = new[] { typeof(Game).Name, typeof(Book).Name },
ExcludeItemTypes = new[] { typeof(Book).Name },
IsPlaceHolder = false,
DtoOptions = GetDtoOptions()
};
@@ -1144,7 +1132,7 @@ namespace Emby.Dlna.ContentDirectory
StartIndex = query.StartIndex,
UserId = query.User.Id
}, new [] { parent }, query.DtoOptions);
}, new[] { parent }, query.DtoOptions);
return ToResult(result);
}
@@ -1298,7 +1286,6 @@ namespace Emby.Dlna.ContentDirectory
private ServerItem ParseItemId(string id, User user)
{
Guid itemId;
StubType? stubType = null;
// After using PlayTo, MediaMonkey sends a request to the server trying to get item info
@@ -1324,7 +1311,7 @@ namespace Emby.Dlna.ContentDirectory
}
}
if (Guid.TryParse(id, out itemId))
if (Guid.TryParse(id, out var itemId))
{
var item = _libraryManager.GetItemById(itemId);

View File

@@ -1,5 +1,5 @@
using Emby.Dlna.Common;
using System.Collections.Generic;
using Emby.Dlna.Common;
namespace Emby.Dlna.ContentDirectory
{
@@ -7,7 +7,7 @@ namespace Emby.Dlna.ContentDirectory
{
public IEnumerable<ServiceAction> GetActions()
{
return new []
return new[]
{
GetSearchCapabilitiesAction(),
GetSortCapabilitiesAction(),
@@ -20,7 +20,7 @@ namespace Emby.Dlna.ContentDirectory
};
}
private ServiceAction GetGetSystemUpdateIDAction()
private static ServiceAction GetGetSystemUpdateIDAction()
{
var action = new ServiceAction
{
@@ -37,7 +37,7 @@ namespace Emby.Dlna.ContentDirectory
return action;
}
private ServiceAction GetSearchCapabilitiesAction()
private static ServiceAction GetSearchCapabilitiesAction()
{
var action = new ServiceAction
{
@@ -54,7 +54,7 @@ namespace Emby.Dlna.ContentDirectory
return action;
}
private ServiceAction GetSortCapabilitiesAction()
private static ServiceAction GetSortCapabilitiesAction()
{
var action = new ServiceAction
{
@@ -71,7 +71,7 @@ namespace Emby.Dlna.ContentDirectory
return action;
}
private ServiceAction GetX_GetFeatureListAction()
private static ServiceAction GetX_GetFeatureListAction()
{
var action = new ServiceAction
{
@@ -88,7 +88,7 @@ namespace Emby.Dlna.ContentDirectory
return action;
}
private ServiceAction GetSearchAction()
private static ServiceAction GetSearchAction()
{
var action = new ServiceAction
{
@@ -334,7 +334,7 @@ namespace Emby.Dlna.ContentDirectory
return action;
}
private ServiceAction GetXSetBookmarkAction()
{
var action = new ServiceAction

View File

@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.IO;
namespace Emby.Dlna

View File

@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
namespace Emby.Dlna
{
@@ -15,4 +15,4 @@ namespace Emby.Dlna
Headers = new Dictionary<string, string>();
}
}
}
}

View File

@@ -1,4 +1,11 @@
using MediaBrowser.Model.Extensions;
using System;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Xml;
using Emby.Dlna.Configuration;
using Emby.Dlna.ContentDirectory;
using MediaBrowser.Controller.Channels;
using MediaBrowser.Controller.Drawing;
using MediaBrowser.Controller.Entities;
@@ -6,23 +13,15 @@ using MediaBrowser.Controller.Entities.Audio;
using MediaBrowser.Controller.Entities.Movies;
using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.MediaEncoding;
using MediaBrowser.Controller.Playlists;
using Emby.Dlna.ContentDirectory;
using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Drawing;
using MediaBrowser.Model.Entities;
using Microsoft.Extensions.Logging;
using MediaBrowser.Model.Net;
using System;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
using MediaBrowser.Controller.MediaEncoding;
using Emby.Dlna.Configuration;
using MediaBrowser.Model.Extensions;
using MediaBrowser.Model.Globalization;
using MediaBrowser.Model.Net;
using Microsoft.Extensions.Logging;
namespace Emby.Dlna.Didl
{
@@ -44,22 +43,30 @@ namespace Emby.Dlna.Didl
private readonly ILocalizationManager _localization;
private readonly IMediaSourceManager _mediaSourceManager;
private readonly ILogger _logger;
private readonly ILibraryManager _libraryManager;
private readonly IMediaEncoder _mediaEncoder;
public DidlBuilder(DeviceProfile profile, User user, IImageProcessor imageProcessor, string serverAddress, string accessToken, IUserDataManager userDataManager, ILocalizationManager localization, IMediaSourceManager mediaSourceManager, ILogger logger, ILibraryManager libraryManager, IMediaEncoder mediaEncoder)
public DidlBuilder(
DeviceProfile profile,
User user,
IImageProcessor imageProcessor,
string serverAddress,
string accessToken,
IUserDataManager userDataManager,
ILocalizationManager localization,
IMediaSourceManager mediaSourceManager,
ILogger logger,
IMediaEncoder mediaEncoder)
{
_profile = profile;
_user = user;
_imageProcessor = imageProcessor;
_serverAddress = serverAddress;
_accessToken = accessToken;
_userDataManager = userDataManager;
_localization = localization;
_mediaSourceManager = mediaSourceManager;
_logger = logger;
_libraryManager = libraryManager;
_mediaEncoder = mediaEncoder;
_accessToken = accessToken;
_user = user;
}
public static string NormalizeDlnaMediaUrl(string url)
@@ -79,7 +86,7 @@ namespace Emby.Dlna.Didl
using (StringWriter builder = new StringWriterWithEncoding(Encoding.UTF8))
{
using (XmlWriter writer = XmlWriter.Create(builder, settings))
using (var writer = XmlWriter.Create(builder, settings))
{
//writer.WriteStartDocument();
@@ -118,7 +125,8 @@ namespace Emby.Dlna.Didl
}
}
public void WriteItemElement(DlnaOptions options,
public void WriteItemElement(
DlnaOptions options,
XmlWriter writer,
BaseItem item,
User user,
@@ -233,12 +241,15 @@ namespace Emby.Dlna.Didl
AddVideoResource(writer, video, deviceId, filter, contentFeature, streamInfo);
}
var subtitleProfiles = streamInfo.GetSubtitleProfiles(_mediaEncoder, false, _serverAddress, _accessToken)
.Where(subtitle => subtitle.DeliveryMethod == SubtitleDeliveryMethod.External)
.ToList();
var subtitleProfiles = streamInfo.GetSubtitleProfiles(_mediaEncoder, false, _serverAddress, _accessToken);
foreach (var subtitle in subtitleProfiles)
{
if (subtitle.DeliveryMethod != SubtitleDeliveryMethod.External)
{
continue;
}
var subtitleAdded = AddSubtitleElement(writer, subtitle);
if (subtitleAdded && _profile.EnableSingleSubtitleLimit)
@@ -251,7 +262,8 @@ namespace Emby.Dlna.Didl
private bool AddSubtitleElement(XmlWriter writer, SubtitleStreamInfo info)
{
var subtitleProfile = _profile.SubtitleProfiles
.FirstOrDefault(i => string.Equals(info.Format, i.Format, StringComparison.OrdinalIgnoreCase) && i.Method == SubtitleDeliveryMethod.External);
.FirstOrDefault(i => string.Equals(info.Format, i.Format, StringComparison.OrdinalIgnoreCase)
&& i.Method == SubtitleDeliveryMethod.External);
if (subtitleProfile == null)
{
@@ -266,7 +278,7 @@ namespace Emby.Dlna.Didl
// <sec:CaptionInfo sec:type="srt">http://192.168.1.3:9999/video.srt</sec:CaptionInfo>
writer.WriteStartElement("sec", "CaptionInfoEx", null);
writer.WriteAttributeString("sec", "type", null, info.Format.ToLower());
writer.WriteAttributeString("sec", "type", null, info.Format.ToLowerInvariant());
writer.WriteString(info.Url);
writer.WriteFullEndElement();
@@ -283,7 +295,7 @@ namespace Emby.Dlna.Didl
else
{
writer.WriteStartElement(string.Empty, "res", NS_DIDL);
var protocolInfo = string.Format("http-get:*:text/{0}:*", info.Format.ToLower());
var protocolInfo = string.Format("http-get:*:text/{0}:*", info.Format.ToLowerInvariant());
writer.WriteAttributeString("protocolInfo", protocolInfo);
writer.WriteString(info.Url);
@@ -375,7 +387,7 @@ namespace Emby.Dlna.Didl
? GetMimeType(filename)
: mediaProfile.MimeType;
writer.WriteAttributeString("protocolInfo", String.Format(
writer.WriteAttributeString("protocolInfo", string.Format(
"http-get:*:{0}:{1}",
mimeType,
contentFeatures
@@ -388,91 +400,39 @@ namespace Emby.Dlna.Didl
private string GetDisplayName(BaseItem item, StubType? itemStubType, BaseItem context)
{
if (itemStubType.HasValue && itemStubType.Value == StubType.Latest)
if (itemStubType.HasValue)
{
return _localization.GetLocalizedString("Latest");
}
if (itemStubType.HasValue && itemStubType.Value == StubType.Playlists)
{
return _localization.GetLocalizedString("Playlists");
}
if (itemStubType.HasValue && itemStubType.Value == StubType.AlbumArtists)
{
return _localization.GetLocalizedString("HeaderAlbumArtists");
}
if (itemStubType.HasValue && itemStubType.Value == StubType.Albums)
{
return _localization.GetLocalizedString("Albums");
}
if (itemStubType.HasValue && itemStubType.Value == StubType.Artists)
{
return _localization.GetLocalizedString("Artists");
}
if (itemStubType.HasValue && itemStubType.Value == StubType.Songs)
{
return _localization.GetLocalizedString("Songs");
}
if (itemStubType.HasValue && itemStubType.Value == StubType.Genres)
{
return _localization.GetLocalizedString("Genres");
}
if (itemStubType.HasValue && itemStubType.Value == StubType.FavoriteAlbums)
{
return _localization.GetLocalizedString("HeaderFavoriteAlbums");
}
if (itemStubType.HasValue && itemStubType.Value == StubType.FavoriteArtists)
{
return _localization.GetLocalizedString("HeaderFavoriteArtists");
}
if (itemStubType.HasValue && itemStubType.Value == StubType.FavoriteSongs)
{
return _localization.GetLocalizedString("HeaderFavoriteSongs");
}
if (itemStubType.HasValue && itemStubType.Value == StubType.ContinueWatching)
{
return _localization.GetLocalizedString("HeaderContinueWatching");
}
if (itemStubType.HasValue && itemStubType.Value == StubType.Movies)
{
return _localization.GetLocalizedString("Movies");
}
if (itemStubType.HasValue && itemStubType.Value == StubType.Collections)
{
return _localization.GetLocalizedString("Collections");
}
if (itemStubType.HasValue && itemStubType.Value == StubType.Favorites)
{
return _localization.GetLocalizedString("Favorites");
}
if (itemStubType.HasValue && itemStubType.Value == StubType.NextUp)
{
return _localization.GetLocalizedString("HeaderNextUp");
}
if (itemStubType.HasValue && itemStubType.Value == StubType.FavoriteSeries)
{
return _localization.GetLocalizedString("HeaderFavoriteShows");
}
if (itemStubType.HasValue && itemStubType.Value == StubType.FavoriteEpisodes)
{
return _localization.GetLocalizedString("HeaderFavoriteEpisodes");
}
if (itemStubType.HasValue && itemStubType.Value == StubType.Series)
{
return _localization.GetLocalizedString("Shows");
switch (itemStubType.Value)
{
case StubType.Latest: return _localization.GetLocalizedString("Latest");
case StubType.Playlists: return _localization.GetLocalizedString("Playlists");
case StubType.AlbumArtists: return _localization.GetLocalizedString("HeaderAlbumArtists");
case StubType.Albums: return _localization.GetLocalizedString("Albums");
case StubType.Artists: return _localization.GetLocalizedString("Artists");
case StubType.Songs: return _localization.GetLocalizedString("Songs");
case StubType.Genres: return _localization.GetLocalizedString("Genres");
case StubType.FavoriteAlbums: return _localization.GetLocalizedString("HeaderFavoriteAlbums");
case StubType.FavoriteArtists: return _localization.GetLocalizedString("HeaderFavoriteArtists");
case StubType.FavoriteSongs: return _localization.GetLocalizedString("HeaderFavoriteSongs");
case StubType.ContinueWatching: return _localization.GetLocalizedString("HeaderContinueWatching");
case StubType.Movies: return _localization.GetLocalizedString("Movies");
case StubType.Collections: return _localization.GetLocalizedString("Collections");
case StubType.Favorites: return _localization.GetLocalizedString("Favorites");
case StubType.NextUp: return _localization.GetLocalizedString("HeaderNextUp");
case StubType.FavoriteSeries: return _localization.GetLocalizedString("HeaderFavoriteShows");
case StubType.FavoriteEpisodes: return _localization.GetLocalizedString("HeaderFavoriteEpisodes");
case StubType.Series: return _localization.GetLocalizedString("Shows");
default: break;
}
}
var episode = item as Episode;
var season = context as Season;
if (episode != null && season != null)
if (item is Episode episode && context is Season season)
{
// This is a special embedded within a season
if (item.ParentIndexNumber.HasValue && item.ParentIndexNumber.Value == 0)
if (item.ParentIndexNumber.HasValue && item.ParentIndexNumber.Value == 0
&& season.IndexNumber.HasValue && season.IndexNumber.Value != 0)
{
if (season.IndexNumber.HasValue && season.IndexNumber.Value != 0)
{
return string.Format(_localization.GetLocalizedString("ValueSpecialEpisodeName"), item.Name);
}
return string.Format(_localization.GetLocalizedString("ValueSpecialEpisodeName"), item.Name);
}
if (item.IndexNumber.HasValue)
@@ -573,7 +533,7 @@ namespace Emby.Dlna.Didl
streamInfo.RunTimeTicks ?? 0,
streamInfo.TranscodeSeekInfo);
writer.WriteAttributeString("protocolInfo", String.Format(
writer.WriteAttributeString("protocolInfo", string.Format(
"http-get:*:{0}:{1}",
mimeType,
contentFeatures
@@ -586,10 +546,8 @@ namespace Emby.Dlna.Didl
public static bool IsIdRoot(string id)
{
if (string.IsNullOrWhiteSpace(id) ||
string.Equals(id, "0", StringComparison.OrdinalIgnoreCase)
if (string.IsNullOrWhiteSpace(id)
|| string.Equals(id, "0", StringComparison.OrdinalIgnoreCase)
// Samsung sometimes uses 1 as root
|| string.Equals(id, "1", StringComparison.OrdinalIgnoreCase))
{
@@ -809,7 +767,7 @@ namespace Emby.Dlna.Didl
{
writer.WriteString(_profile.RequiresPlainFolders ? "object.container.storageFolder" : "object.container.genre.musicGenre");
}
else if (item is Genre || item is GameGenre)
else if (item is Genre)
{
writer.WriteString(_profile.RequiresPlainFolders ? "object.container.storageFolder" : "object.container.genre");
}
@@ -845,7 +803,7 @@ namespace Emby.Dlna.Didl
// var type = types.FirstOrDefault(i => string.Equals(i, actor.Type, StringComparison.OrdinalIgnoreCase) || string.Equals(i, actor.Role, StringComparison.OrdinalIgnoreCase))
// ?? PersonType.Actor;
// AddValue(writer, "upnp", type.ToLower(), actor.Name, NS_UPNP);
// AddValue(writer, "upnp", type.ToLowerInvariant(), actor.Name, NS_UPNP);
// index++;
@@ -933,13 +891,7 @@ namespace Emby.Dlna.Didl
private void AddCover(BaseItem item, BaseItem context, StubType? stubType, XmlWriter writer)
{
ImageDownloadInfo imageInfo = null;
// Finally, just use the image from the item
if (imageInfo == null)
{
imageInfo = GetImageInfo(item);
}
ImageDownloadInfo imageInfo = GetImageInfo(item);
if (imageInfo == null)
{
@@ -1017,7 +969,7 @@ namespace Emby.Dlna.Didl
var contentFeatures = new ContentFeatureBuilder(_profile)
.BuildImageHeader(format, width, height, imageInfo.IsDirectStream, org_Pn);
writer.WriteAttributeString("protocolInfo", String.Format(
writer.WriteAttributeString("protocolInfo", string.Format(
"http-get:*:{0}:{1}",
GetMimeType("file." + format),
contentFeatures
@@ -1095,8 +1047,8 @@ namespace Emby.Dlna.Didl
//{
// var size = _imageProcessor.GetImageSize(imageInfo);
// width = Convert.ToInt32(size.Width);
// height = Convert.ToInt32(size.Height);
// width = size.Width;
// height = size.Height;
//}
//catch
//{
@@ -1119,7 +1071,7 @@ namespace Emby.Dlna.Didl
};
}
class ImageDownloadInfo
private class ImageDownloadInfo
{
internal Guid ItemId;
internal string ImageTag;
@@ -1135,7 +1087,7 @@ namespace Emby.Dlna.Didl
internal ItemImageInfo ItemImageInfo;
}
class ImageUrlInfo
private class ImageUrlInfo
{
internal string Url;
@@ -1154,7 +1106,7 @@ namespace Emby.Dlna.Didl
if (stubType.HasValue)
{
id = stubType.Value.ToString().ToLower() + "_" + id;
id = stubType.Value.ToString().ToLowerInvariant() + "_" + id;
}
return id;
@@ -1169,8 +1121,7 @@ namespace Emby.Dlna.Didl
info.ImageTag,
format,
maxWidth.ToString(CultureInfo.InvariantCulture),
maxHeight.ToString(CultureInfo.InvariantCulture)
);
maxHeight.ToString(CultureInfo.InvariantCulture));
var width = info.Width;
var height = info.Height;
@@ -1179,15 +1130,11 @@ namespace Emby.Dlna.Didl
if (width.HasValue && height.HasValue)
{
var newSize = DrawingUtils.Resize(new ImageSize
{
Height = height.Value,
Width = width.Value
var newSize = DrawingUtils.Resize(
new ImageDimensions(width.Value, height.Value), 0, 0, maxWidth, maxHeight);
}, 0, 0, maxWidth, maxHeight);
width = Convert.ToInt32(newSize.Width);
height = Convert.ToInt32(newSize.Height);
width = newSize.Width;
height = newSize.Height;
var normalizedFormat = format
.Replace("jpeg", "jpg", StringComparison.OrdinalIgnoreCase);

View File

@@ -1,6 +1,5 @@
using MediaBrowser.Model.Extensions;
using System;
using System.Collections.Generic;
using MediaBrowser.Model.Extensions;
namespace Emby.Dlna.Didl
{

View File

@@ -1,8 +1,6 @@
using System;
using System.Collections.Generic;
using System;
using System.IO;
using System.Text;
using System.Threading.Tasks;
namespace Emby.Dlna.Didl
{
@@ -53,9 +51,6 @@ namespace Emby.Dlna.Didl
_encoding = encoding;
}
public override Encoding Encoding
{
get { return (null == _encoding) ? base.Encoding : _encoding; }
}
public override Encoding Encoding => (null == _encoding) ? base.Encoding : _encoding;
}
}

View File

@@ -1,24 +1,23 @@
using MediaBrowser.Common.Configuration;
using MediaBrowser.Common.Extensions;
using MediaBrowser.Controller;
using MediaBrowser.Controller.Dlna;
using MediaBrowser.Controller.Drawing;
using MediaBrowser.Controller.Plugins;
using Emby.Dlna.Profiles;
using Emby.Dlna.Server;
using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Drawing;
using Microsoft.Extensions.Logging;
using MediaBrowser.Model.Serialization;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using Emby.Dlna.Profiles;
using Emby.Dlna.Server;
using MediaBrowser.Common.Configuration;
using MediaBrowser.Common.Extensions;
using MediaBrowser.Controller;
using MediaBrowser.Controller.Dlna;
using MediaBrowser.Controller.Drawing;
using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Drawing;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.Reflection;
using MediaBrowser.Model.Extensions;
using MediaBrowser.Model.Serialization;
using Microsoft.Extensions.Logging;
namespace Emby.Dlna
{
@@ -34,26 +33,27 @@ namespace Emby.Dlna
private readonly Dictionary<string, Tuple<InternalProfileInfo, DeviceProfile>> _profiles = new Dictionary<string, Tuple<InternalProfileInfo, DeviceProfile>>(StringComparer.Ordinal);
public DlnaManager(IXmlSerializer xmlSerializer,
public DlnaManager(
IXmlSerializer xmlSerializer,
IFileSystem fileSystem,
IApplicationPaths appPaths,
ILogger logger,
ILoggerFactory loggerFactory,
IJsonSerializer jsonSerializer, IServerApplicationHost appHost, IAssemblyInfo assemblyInfo)
{
_xmlSerializer = xmlSerializer;
_fileSystem = fileSystem;
_appPaths = appPaths;
_logger = logger;
_logger = loggerFactory.CreateLogger("Dlna");
_jsonSerializer = jsonSerializer;
_appHost = appHost;
_assemblyInfo = assemblyInfo;
}
public void InitProfiles()
public async Task InitProfilesAsync()
{
try
{
ExtractSystemProfiles();
await ExtractSystemProfilesAsync();
LoadProfiles();
}
catch (Exception ex)
@@ -95,7 +95,7 @@ namespace Emby.Dlna
{
if (deviceInfo == null)
{
throw new ArgumentNullException("deviceInfo");
throw new ArgumentNullException(nameof(deviceInfo));
}
var profile = GetProfiles()
@@ -207,7 +207,7 @@ namespace Emby.Dlna
{
if (headers == null)
{
throw new ArgumentNullException("headers");
throw new ArgumentNullException(nameof(headers));
}
// Convert to case insensitive
@@ -241,9 +241,7 @@ namespace Emby.Dlna
return false;
}
string value;
if (headers.TryGetValue(header.Name, out value))
if (headers.TryGetValue(header.Name, out string value))
{
switch (header.Match)
{
@@ -263,21 +261,9 @@ namespace Emby.Dlna
return false;
}
private string UserProfilesPath
{
get
{
return Path.Combine(_appPaths.ConfigurationDirectoryPath, "dlna", "user");
}
}
private string UserProfilesPath => Path.Combine(_appPaths.ConfigurationDirectoryPath, "dlna", "user");
private string SystemProfilesPath
{
get
{
return Path.Combine(_appPaths.ConfigurationDirectoryPath, "dlna", "system");
}
}
private string SystemProfilesPath => Path.Combine(_appPaths.ConfigurationDirectoryPath, "dlna", "system");
private IEnumerable<DeviceProfile> GetProfiles(string path, DeviceProfileType type)
{
@@ -302,8 +288,7 @@ namespace Emby.Dlna
{
lock (_profiles)
{
Tuple<InternalProfileInfo, DeviceProfile> profileTuple;
if (_profiles.TryGetValue(path, out profileTuple))
if (_profiles.TryGetValue(path, out Tuple<InternalProfileInfo, DeviceProfile> profileTuple))
{
return profileTuple.Item2;
}
@@ -316,7 +301,7 @@ namespace Emby.Dlna
profile = ReserializeProfile(tempProfile);
profile.Id = path.ToLower().GetMD5().ToString("N");
profile.Id = path.ToLowerInvariant().GetMD5().ToString("N");
_profiles[path] = new Tuple<InternalProfileInfo, DeviceProfile>(GetInternalProfileInfo(_fileSystem.GetFileInfo(path), type), profile);
@@ -335,7 +320,7 @@ namespace Emby.Dlna
{
if (string.IsNullOrEmpty(id))
{
throw new ArgumentNullException("id");
throw new ArgumentNullException(nameof(id));
}
var info = GetProfileInfosInternal().First(i => string.Equals(i.Info.Id, id, StringComparison.OrdinalIgnoreCase));
@@ -368,14 +353,14 @@ namespace Emby.Dlna
Info = new DeviceProfileInfo
{
Id = file.FullName.ToLower().GetMD5().ToString("N"),
Id = file.FullName.ToLowerInvariant().GetMD5().ToString("N"),
Name = _fileSystem.GetFileNameWithoutExtension(file),
Type = type
}
};
}
private void ExtractSystemProfiles()
private async Task ExtractSystemProfilesAsync()
{
var namespaceName = GetType().Namespace + ".Profiles.Xml.";
@@ -395,18 +380,18 @@ namespace Emby.Dlna
if (!fileInfo.Exists || fileInfo.Length != stream.Length)
{
_fileSystem.CreateDirectory(systemProfilesPath);
Directory.CreateDirectory(systemProfilesPath);
using (var fileStream = _fileSystem.GetFileStream(path, FileOpenMode.Create, FileAccessMode.Write, FileShareMode.Read))
{
stream.CopyTo(fileStream);
await stream.CopyToAsync(fileStream);
}
}
}
}
// Not necessary, but just to make it easy to find
_fileSystem.CreateDirectory(UserProfilesPath);
Directory.CreateDirectory(UserProfilesPath);
}
public void DeleteProfile(string id)
@@ -522,7 +507,7 @@ namespace Emby.Dlna
? ImageFormat.Png
: ImageFormat.Jpg;
var resource = GetType().Namespace + ".Images." + filename.ToLower();
var resource = GetType().Namespace + ".Images." + filename.ToLowerInvariant();
return new ImageStream
{

View File

@@ -1,4 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<ItemGroup>
<Compile Include="..\SharedVersion.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MediaBrowser.Model\MediaBrowser.Model.csproj" />

View File

@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
namespace Emby.Dlna
{

View File

@@ -1,7 +1,3 @@
using MediaBrowser.Common.Extensions;
using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Dlna;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
@@ -9,6 +5,9 @@ using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MediaBrowser.Common.Extensions;
using MediaBrowser.Common.Net;
using Microsoft.Extensions.Logging;
namespace Emby.Dlna.Eventing
{
@@ -83,9 +82,7 @@ namespace Emby.Dlna.Eventing
// Starts with SECOND-
header = header.Split('-').Last();
int val;
if (int.TryParse(header, NumberStyles.Integer, _usCulture, out val))
if (int.TryParse(header, NumberStyles.Integer, _usCulture, out var val))
{
return val;
}
@@ -98,8 +95,7 @@ namespace Emby.Dlna.Eventing
{
_logger.LogDebug("Cancelling event subscription {0}", subscriptionId);
EventSubscription sub;
_subscriptions.TryRemove(subscriptionId, out sub);
_subscriptions.TryRemove(subscriptionId, out EventSubscription sub);
return new EventSubscriptionResponse
{
@@ -130,9 +126,7 @@ namespace Emby.Dlna.Eventing
private EventSubscription GetSubscription(string id, bool throwOnMissing)
{
EventSubscription e;
if (!_subscriptions.TryGetValue(id, out e) && throwOnMissing)
if (!_subscriptions.TryGetValue(id, out EventSubscription e) && throwOnMissing)
{
throw new ResourceNotFoundException("Event with Id " + id + " not found.");
}

View File

@@ -1,4 +1,4 @@
using System;
using System;
namespace Emby.Dlna.Eventing
{
@@ -23,12 +23,6 @@ namespace Emby.Dlna.Eventing
TriggerCount++;
}
public bool IsExpired
{
get
{
return SubscriptionTime.AddSeconds(TimeoutSeconds) >= DateTime.UtcNow;
}
}
public bool IsExpired => SubscriptionTime.AddSeconds(TimeoutSeconds) >= DateTime.UtcNow;
}
}

View File

@@ -1,4 +1,4 @@

namespace Emby.Dlna
{
public interface IConnectionManager : IEventManager, IUpnpService

View File

@@ -1,4 +1,4 @@

namespace Emby.Dlna
{
public interface IContentDirectory : IEventManager, IUpnpService

View File

@@ -1,4 +1,4 @@

namespace Emby.Dlna
{
public interface IEventManager

View File

@@ -1,4 +1,4 @@

namespace Emby.Dlna
{
public interface IMediaReceiverRegistrar : IEventManager, IUpnpService

View File

@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
namespace Emby.Dlna
{
@@ -10,7 +10,7 @@ namespace Emby.Dlna
/// <param name="headers">The headers.</param>
/// <returns>System.String.</returns>
string GetServiceXml(IDictionary<string, string> headers);
/// <summary>
/// Processes the control request.
/// </summary>

View File

@@ -1,4 +1,10 @@
using MediaBrowser.Common.Configuration;
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Emby.Dlna.PlayTo;
using Emby.Dlna.Ssdp;
using MediaBrowser.Common.Configuration;
using MediaBrowser.Common.Extensions;
using MediaBrowser.Common.Net;
using MediaBrowser.Controller;
@@ -6,25 +12,18 @@ using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Dlna;
using MediaBrowser.Controller.Drawing;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.MediaEncoding;
using MediaBrowser.Controller.Plugins;
using MediaBrowser.Controller.Session;
using MediaBrowser.Controller.TV;
using Emby.Dlna.PlayTo;
using Emby.Dlna.Ssdp;
using Microsoft.Extensions.Logging;
using System;
using System.Linq;
using System.Threading.Tasks;
using MediaBrowser.Controller.MediaEncoding;
using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Globalization;
using MediaBrowser.Model.Net;
using MediaBrowser.Model.System;
using MediaBrowser.Model.Threading;
using MediaBrowser.Model.Xml;
using Microsoft.Extensions.Logging;
using Rssdp;
using Rssdp.Infrastructure;
using System.Threading;
namespace Emby.Dlna.Main
{
@@ -49,8 +48,7 @@ namespace Emby.Dlna.Main
private readonly IDeviceDiscovery _deviceDiscovery;
private SsdpDevicePublisher _Publisher;
private readonly ITimerFactory _timerFactory;
private readonly ISocketFactory _socketFactory;
private readonly IEnvironmentInfo _environmentInfo;
private readonly INetworkManager _networkManager;
@@ -75,11 +73,10 @@ namespace Emby.Dlna.Main
IUserDataManager userDataManager,
ILocalizationManager localizationManager,
IMediaSourceManager mediaSourceManager,
IDeviceDiscovery deviceDiscovery,
IMediaEncoder mediaEncoder,
ISocketFactory socketFactory,
ITimerFactory timerFactory,
IEnvironmentInfo environmentInfo,
IDeviceDiscovery deviceDiscovery,
IMediaEncoder mediaEncoder,
ISocketFactory socketFactory,
IEnvironmentInfo environmentInfo,
INetworkManager networkManager,
IUserViewManager userViewManager,
IXmlReaderSettingsFactory xmlReaderSettingsFactory,
@@ -99,24 +96,23 @@ namespace Emby.Dlna.Main
_deviceDiscovery = deviceDiscovery;
_mediaEncoder = mediaEncoder;
_socketFactory = socketFactory;
_timerFactory = timerFactory;
_environmentInfo = environmentInfo;
_networkManager = networkManager;
_logger = loggerFactory.CreateLogger("Dlna");
ContentDirectory = new ContentDirectory.ContentDirectory(dlnaManager,
userDataManager,
imageProcessor,
libraryManager,
config,
userManager,
_logger,
httpClient,
localizationManager,
mediaSourceManager,
ContentDirectory = new ContentDirectory.ContentDirectory(dlnaManager,
userDataManager,
imageProcessor,
libraryManager,
config,
userManager,
_logger,
httpClient,
localizationManager,
mediaSourceManager,
userViewManager,
mediaEncoder,
xmlReaderSettingsFactory,
mediaEncoder,
xmlReaderSettingsFactory,
tvSeriesManager);
ConnectionManager = new ConnectionManager.ConnectionManager(dlnaManager, config, _logger, httpClient, xmlReaderSettingsFactory);
@@ -125,9 +121,9 @@ namespace Emby.Dlna.Main
Current = this;
}
public void Run()
public async Task RunAsync()
{
((DlnaManager)_dlnaManager).InitProfiles();
await ((DlnaManager)_dlnaManager).InitProfilesAsync().ConfigureAwait(false);
ReloadComponents();
@@ -233,7 +229,7 @@ namespace Emby.Dlna.Main
try
{
_Publisher = new SsdpDevicePublisher(_communicationsServer, _timerFactory, _environmentInfo.OperatingSystemName, _environmentInfo.OperatingSystemVersion);
_Publisher = new SsdpDevicePublisher(_communicationsServer, _environmentInfo.OperatingSystemName, _environmentInfo.OperatingSystemVersion);
_Publisher.LogFunction = LogMessage;
_Publisher.SupportPnpRootDevice = false;
@@ -263,7 +259,7 @@ namespace Emby.Dlna.Main
var fullService = "urn:schemas-upnp-org:device:MediaServer:1";
_logger.LogInformation("Registering publisher for {0} on {1}", fullService, address.ToString());
_logger.LogInformation("Registering publisher for {0} on {1}", fullService, address);
var descriptorUri = "/dlna/" + udn + "/description.xml";
var uri = new Uri(_appHost.GetLocalApiUrl(address) + descriptorUri);
@@ -271,18 +267,18 @@ namespace Emby.Dlna.Main
var device = new SsdpRootDevice
{
CacheLifetime = TimeSpan.FromSeconds(1800), //How long SSDP clients can cache this info.
Location = uri, // Must point to the URL that serves your devices UPnP description document.
Location = uri, // Must point to the URL that serves your devices UPnP description document.
FriendlyName = "Jellyfin",
Manufacturer = "Jellyfin",
ModelName = "Jellyfin Server",
Uuid = udn
// This must be a globally unique value that survives reboots etc. Get from storage or embedded hardware etc.
// This must be a globally unique value that survives reboots etc. Get from storage or embedded hardware etc.
};
SetProperies(device, fullService);
_Publisher.AddDevice(device);
var embeddedDevices = new []
var embeddedDevices = new[]
{
"urn:schemas-upnp-org:service:ContentDirectory:1",
"urn:schemas-upnp-org:service:ConnectionManager:1",
@@ -297,7 +293,7 @@ namespace Emby.Dlna.Main
Manufacturer = device.Manufacturer,
ModelName = device.ModelName,
Uuid = udn
// This must be a globally unique value that survives reboots etc. Get from storage or embedded hardware etc.
// This must be a globally unique value that survives reboots etc. Get from storage or embedded hardware etc.
};
SetProperies(embeddedDevice, subDevice);
@@ -308,8 +304,7 @@ namespace Emby.Dlna.Main
private string CreateUuid(string text)
{
Guid guid;
if (!Guid.TryParse(text, out guid))
if (!Guid.TryParse(text, out var guid))
{
guid = text.GetMD5();
}
@@ -354,8 +349,7 @@ namespace Emby.Dlna.Main
_userDataManager,
_localization,
_mediaSourceManager,
_mediaEncoder,
_timerFactory);
_mediaEncoder);
_manager.Start();
}

View File

@@ -1,11 +1,10 @@
using MediaBrowser.Common.Extensions;
using MediaBrowser.Controller.Configuration;
using Emby.Dlna.Server;
using Emby.Dlna.Service;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using Emby.Dlna.Service;
using MediaBrowser.Common.Extensions;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Model.Xml;
using Microsoft.Extensions.Logging;
namespace Emby.Dlna.MediaReceiverRegistrar
{
@@ -21,7 +20,7 @@ namespace Emby.Dlna.MediaReceiverRegistrar
throw new ResourceNotFoundException("Unexpected control request name: " + methodName);
}
private IEnumerable<KeyValuePair<string, string>> HandleIsAuthorized()
private static IEnumerable<KeyValuePair<string, string>> HandleIsAuthorized()
{
return new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
{
@@ -29,7 +28,7 @@ namespace Emby.Dlna.MediaReceiverRegistrar
};
}
private IEnumerable<KeyValuePair<string, string>> HandleIsValidated()
private static IEnumerable<KeyValuePair<string, string>> HandleIsValidated()
{
return new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
{

View File

@@ -1,11 +1,9 @@
using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Dlna;
using Emby.Dlna.Service;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using Emby.Dlna.Service;
using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Model.Xml;
using Microsoft.Extensions.Logging;
namespace Emby.Dlna.MediaReceiverRegistrar
{

View File

@@ -1,6 +1,6 @@
using Emby.Dlna.Common;
using Emby.Dlna.Service;
using System.Collections.Generic;
using Emby.Dlna.Common;
using Emby.Dlna.Service;
namespace Emby.Dlna.MediaReceiverRegistrar
{
@@ -12,7 +12,7 @@ namespace Emby.Dlna.MediaReceiverRegistrar
GetStateVariables());
}
private IEnumerable<StateVariable> GetStateVariables()
private static IEnumerable<StateVariable> GetStateVariables()
{
var list = new List<StateVariable>();

View File

@@ -1,5 +1,5 @@
using Emby.Dlna.Common;
using System.Collections.Generic;
using Emby.Dlna.Common;
namespace Emby.Dlna.MediaReceiverRegistrar
{
@@ -7,7 +7,7 @@ namespace Emby.Dlna.MediaReceiverRegistrar
{
public IEnumerable<ServiceAction> GetActions()
{
return new []
return new[]
{
GetIsValidated(),
GetIsAuthorized(),
@@ -19,7 +19,7 @@ namespace Emby.Dlna.MediaReceiverRegistrar
};
}
private ServiceAction GetIsValidated()
private static ServiceAction GetIsValidated()
{
var action = new ServiceAction
{
@@ -41,7 +41,7 @@ namespace Emby.Dlna.MediaReceiverRegistrar
return action;
}
private ServiceAction GetIsAuthorized()
private static ServiceAction GetIsAuthorized()
{
var action = new ServiceAction
{
@@ -63,7 +63,7 @@ namespace Emby.Dlna.MediaReceiverRegistrar
return action;
}
private ServiceAction GetRegisterDevice()
private static ServiceAction GetRegisterDevice()
{
var action = new ServiceAction
{
@@ -85,7 +85,7 @@ namespace Emby.Dlna.MediaReceiverRegistrar
return action;
}
private ServiceAction GetGetValidationSucceededUpdateID()
private static ServiceAction GetGetValidationSucceededUpdateID()
{
var action = new ServiceAction
{

View File

@@ -1,9 +1,9 @@
using System;
using System;
namespace Emby.Dlna.PlayTo
{
public class CurrentIdEventArgs : EventArgs
{
public string Id { get; set; }
public string Id { get; set; }
}
}

View File

@@ -1,21 +1,16 @@
using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Configuration;
using Emby.Dlna.Common;
using Emby.Dlna.Ssdp;
using Microsoft.Extensions.Logging;
using MediaBrowser.Model.Net;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Net;
using System.Security;
using System.Threading;
using System.Threading.Tasks;
using System.Xml.Linq;
using Emby.Dlna.Common;
using Emby.Dlna.Server;
using MediaBrowser.Model.Threading;
using MediaBrowser.Model.Extensions;
using Emby.Dlna.Ssdp;
using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Configuration;
using Microsoft.Extensions.Logging;
namespace Emby.Dlna.PlayTo
{
@@ -23,7 +18,7 @@ namespace Emby.Dlna.PlayTo
{
#region Fields & Properties
private ITimer _timer;
private Timer _timer;
public DeviceInfo Properties { get; set; }
@@ -39,52 +34,20 @@ namespace Emby.Dlna.PlayTo
RefreshVolumeIfNeeded();
return _volume;
}
set
{
_volume = value;
}
set => _volume = value;
}
public TimeSpan? Duration { get; set; }
private TimeSpan _position = TimeSpan.FromSeconds(0);
public TimeSpan Position
{
get
{
return _position;
}
set
{
_position = value;
}
}
public TimeSpan Position { get; set; } = TimeSpan.FromSeconds(0);
public TRANSPORTSTATE TransportState { get; private set; }
public bool IsPlaying
{
get
{
return TransportState == TRANSPORTSTATE.PLAYING;
}
}
public bool IsPlaying => TransportState == TRANSPORTSTATE.PLAYING;
public bool IsPaused
{
get
{
return TransportState == TRANSPORTSTATE.PAUSED || TransportState == TRANSPORTSTATE.PAUSED_PLAYBACK;
}
}
public bool IsPaused => TransportState == TRANSPORTSTATE.PAUSED || TransportState == TRANSPORTSTATE.PAUSED_PLAYBACK;
public bool IsStopped
{
get
{
return TransportState == TRANSPORTSTATE.STOPPED;
}
}
public bool IsStopped => TransportState == TRANSPORTSTATE.STOPPED;
#endregion
@@ -92,24 +55,20 @@ namespace Emby.Dlna.PlayTo
private readonly ILogger _logger;
private readonly IServerConfigurationManager _config;
public DateTime DateLastActivity { get; private set; }
public Action OnDeviceUnavailable { get; set; }
private readonly ITimerFactory _timerFactory;
public Device(DeviceInfo deviceProperties, IHttpClient httpClient, ILogger logger, IServerConfigurationManager config, ITimerFactory timerFactory)
public Device(DeviceInfo deviceProperties, IHttpClient httpClient, ILogger logger, IServerConfigurationManager config)
{
Properties = deviceProperties;
_httpClient = httpClient;
_logger = logger;
_config = config;
_timerFactory = timerFactory;
}
public void Start()
{
_logger.LogDebug("Dlna Device.Start");
_timer = _timerFactory.Create(TimerCallback, null, 1000, Timeout.Infinite);
_timer = new Timer(TimerCallback, null, 1000, Timeout.Infinite);
}
private DateTime _lastVolumeRefresh;
@@ -150,7 +109,9 @@ namespace Emby.Dlna.PlayTo
lock (_timerLock)
{
if (_disposed)
{
return;
}
_volumeRefreshActive = true;
@@ -167,7 +128,9 @@ namespace Emby.Dlna.PlayTo
lock (_timerLock)
{
if (_disposed)
{
return;
}
_volumeRefreshActive = false;
@@ -175,11 +138,6 @@ namespace Emby.Dlna.PlayTo
}
}
public void OnPlaybackStartedExternally()
{
RestartTimer(true);
}
#region Commanding
public Task VolumeDown(CancellationToken cancellationToken)
@@ -311,7 +269,7 @@ namespace Emby.Dlna.PlayTo
throw new InvalidOperationException("Unable to find service");
}
await new SsdpHttpClient(_httpClient, _config).SendCommandAsync(Properties.BaseUrl, service, command.Name, avCommands.BuildPost(command, service.ServiceType, String.Format("{0:hh}:{0:mm}:{0:ss}", value), "REL_TIME"))
await new SsdpHttpClient(_httpClient, _config).SendCommandAsync(Properties.BaseUrl, service, command.Name, avCommands.BuildPost(command, service.ServiceType, string.Format("{0:hh}:{0:mm}:{0:ss}", value), "REL_TIME"))
.ConfigureAwait(false);
RestartTimer(true);
@@ -364,7 +322,9 @@ namespace Emby.Dlna.PlayTo
private string CreateDidlMeta(string value)
{
if (string.IsNullOrEmpty(value))
return String.Empty;
{
return string.Empty;
}
return DescriptionXmlBuilder.Escape(value);
}
@@ -373,10 +333,11 @@ namespace Emby.Dlna.PlayTo
{
var command = avCommands.ServiceActions.FirstOrDefault(c => c.Name == "Play");
if (command == null)
{
return Task.CompletedTask;
}
var service = GetAvTransportService();
if (service == null)
{
throw new InvalidOperationException("Unable to find service");
@@ -400,7 +361,9 @@ namespace Emby.Dlna.PlayTo
var command = avCommands.ServiceActions.FirstOrDefault(c => c.Name == "Stop");
if (command == null)
{
return;
}
var service = GetAvTransportService();
@@ -416,7 +379,9 @@ namespace Emby.Dlna.PlayTo
var command = avCommands.ServiceActions.FirstOrDefault(c => c.Name == "Pause");
if (command == null)
{
return;
}
var service = GetAvTransportService();
@@ -436,7 +401,9 @@ namespace Emby.Dlna.PlayTo
private async void TimerCallback(object sender)
{
if (_disposed)
{
return;
}
try
{
@@ -456,8 +423,6 @@ namespace Emby.Dlna.PlayTo
return;
}
DateLastActivity = DateTime.UtcNow;
if (transportState.HasValue)
{
// If we're not playing anything no need to get additional data
@@ -536,7 +501,9 @@ namespace Emby.Dlna.PlayTo
var command = rendererCommands.ServiceActions.FirstOrDefault(c => c.Name == "GetVolume");
if (command == null)
{
return;
}
var service = GetServiceRenderingControl();
@@ -549,13 +516,17 @@ namespace Emby.Dlna.PlayTo
.ConfigureAwait(false);
if (result == null || result.Document == null)
{
return;
}
var volume = result.Document.Descendants(uPnpNamespaces.RenderingControl + "GetVolumeResponse").Select(i => i.Element("CurrentVolume")).FirstOrDefault(i => i != null);
var volumeValue = volume == null ? null : volume.Value;
var volumeValue = volume?.Value;
if (string.IsNullOrWhiteSpace(volumeValue))
{
return;
}
Volume = int.Parse(volumeValue, UsCulture);
@@ -576,7 +547,9 @@ namespace Emby.Dlna.PlayTo
var command = rendererCommands.ServiceActions.FirstOrDefault(c => c.Name == "GetMute");
if (command == null)
{
return;
}
var service = GetServiceRenderingControl();
@@ -591,41 +564,44 @@ namespace Emby.Dlna.PlayTo
if (result == null || result.Document == null)
return;
var valueNode = result.Document.Descendants(uPnpNamespaces.RenderingControl + "GetMuteResponse").Select(i => i.Element("CurrentMute")).FirstOrDefault(i => i != null);
var value = valueNode == null ? null : valueNode.Value;
var valueNode = result.Document.Descendants(uPnpNamespaces.RenderingControl + "GetMuteResponse")
.Select(i => i.Element("CurrentMute"))
.FirstOrDefault(i => i != null);
IsMuted = string.Equals(value, "1", StringComparison.OrdinalIgnoreCase);
IsMuted = string.Equals(valueNode?.Value, "1", StringComparison.OrdinalIgnoreCase);
}
private async Task<TRANSPORTSTATE?> GetTransportInfo(TransportCommands avCommands, CancellationToken cancellationToken)
{
var command = avCommands.ServiceActions.FirstOrDefault(c => c.Name == "GetTransportInfo");
if (command == null)
{
return null;
}
var service = GetAvTransportService();
if (service == null)
{
return null;
}
var result = await new SsdpHttpClient(_httpClient, _config).SendCommandAsync(Properties.BaseUrl, service, command.Name, avCommands.BuildPost(command, service.ServiceType), false)
.ConfigureAwait(false);
if (result == null || result.Document == null)
{
return null;
}
var transportState =
result.Document.Descendants(uPnpNamespaces.AvTransport + "GetTransportInfoResponse").Select(i => i.Element("CurrentTransportState")).FirstOrDefault(i => i != null);
var transportStateValue = transportState == null ? null : transportState.Value;
if (transportStateValue != null)
if (transportStateValue != null
&& Enum.TryParse(transportStateValue, true, out TRANSPORTSTATE state))
{
TRANSPORTSTATE state;
if (Enum.TryParse(transportStateValue, true, out state))
{
return state;
}
return state;
}
return null;
@@ -635,10 +611,11 @@ namespace Emby.Dlna.PlayTo
{
var command = avCommands.ServiceActions.FirstOrDefault(c => c.Name == "GetMediaInfo");
if (command == null)
{
return null;
}
var service = GetAvTransportService();
if (service == null)
{
throw new InvalidOperationException("Unable to find service");
@@ -650,7 +627,9 @@ namespace Emby.Dlna.PlayTo
.ConfigureAwait(false);
if (result == null || result.Document == null)
{
return null;
}
var track = result.Document.Descendants("CurrentURIMetaData").FirstOrDefault();
@@ -690,11 +669,13 @@ namespace Emby.Dlna.PlayTo
return null;
}
private async Task<Tuple<bool, uBaseObject>> GetPositionInfo(TransportCommands avCommands, CancellationToken cancellationToken)
private async Task<(bool, uBaseObject)> GetPositionInfo(TransportCommands avCommands, CancellationToken cancellationToken)
{
var command = avCommands.ServiceActions.FirstOrDefault(c => c.Name == "GetPositionInfo");
if (command == null)
return new Tuple<bool, uBaseObject>(false, null);
{
return (false, null);
}
var service = GetAvTransportService();
@@ -709,7 +690,9 @@ namespace Emby.Dlna.PlayTo
.ConfigureAwait(false);
if (result == null || result.Document == null)
return new Tuple<bool, uBaseObject>(false, null);
{
return (false, null);
}
var trackUriElem = result.Document.Descendants(uPnpNamespaces.AvTransport + "GetPositionInfoResponse").Select(i => i.Element("TrackURI")).FirstOrDefault(i => i != null);
var trackUri = trackUriElem == null ? null : trackUriElem.Value;
@@ -717,8 +700,8 @@ namespace Emby.Dlna.PlayTo
var durationElem = result.Document.Descendants(uPnpNamespaces.AvTransport + "GetPositionInfoResponse").Select(i => i.Element("TrackDuration")).FirstOrDefault(i => i != null);
var duration = durationElem == null ? null : durationElem.Value;
if (!string.IsNullOrWhiteSpace(duration) &&
!string.Equals(duration, "NOT_IMPLEMENTED", StringComparison.OrdinalIgnoreCase))
if (!string.IsNullOrWhiteSpace(duration)
&& !string.Equals(duration, "NOT_IMPLEMENTED", StringComparison.OrdinalIgnoreCase))
{
Duration = TimeSpan.Parse(duration, UsCulture);
}
@@ -739,15 +722,15 @@ namespace Emby.Dlna.PlayTo
if (track == null)
{
//If track is null, some vendors do this, use GetMediaInfo instead
return new Tuple<bool, uBaseObject>(true, null);
//If track is null, some vendors do this, use GetMediaInfo instead
return (true, null);
}
var trackString = (string)track;
if (string.IsNullOrWhiteSpace(trackString) || string.Equals(trackString, "NOT_IMPLEMENTED", StringComparison.OrdinalIgnoreCase))
{
return new Tuple<bool, uBaseObject>(true, null);
return (true, null);
}
XElement uPnpResponse;
@@ -768,7 +751,7 @@ namespace Emby.Dlna.PlayTo
catch (Exception ex)
{
_logger.LogError(ex, "Unable to parse xml {0}", trackString);
return new Tuple<bool, uBaseObject>(true, null);
return (true, null);
}
}
@@ -776,14 +759,14 @@ namespace Emby.Dlna.PlayTo
var uTrack = CreateUBaseObject(e, trackUri);
return new Tuple<bool, uBaseObject>(true, uTrack);
return (true, uTrack);
}
private static uBaseObject CreateUBaseObject(XElement container, string trackUri)
{
if (container == null)
{
throw new ArgumentNullException("container");
throw new ArgumentNullException(nameof(container));
}
var url = container.GetValue(uPnpNamespaces.Res);
@@ -810,7 +793,7 @@ namespace Emby.Dlna.PlayTo
{
if (container == null)
{
throw new ArgumentNullException("container");
throw new ArgumentNullException(nameof(container));
}
var resElement = container.Element(uPnpNamespaces.Res);
@@ -834,11 +817,9 @@ namespace Emby.Dlna.PlayTo
private async Task<TransportCommands> GetAVProtocolAsync(CancellationToken cancellationToken)
{
var avCommands = AvCommands;
if (avCommands != null)
if (AvCommands != null)
{
return avCommands;
return AvCommands;
}
if (_disposed)
@@ -858,18 +839,15 @@ namespace Emby.Dlna.PlayTo
var document = await httpClient.GetDataAsync(url, cancellationToken).ConfigureAwait(false);
avCommands = TransportCommands.Create(document);
AvCommands = avCommands;
return avCommands;
AvCommands = TransportCommands.Create(document);
return AvCommands;
}
private async Task<TransportCommands> GetRenderingProtocolAsync(CancellationToken cancellationToken)
{
var rendererCommands = RendererCommands;
if (rendererCommands != null)
if (RendererCommands != null)
{
return rendererCommands;
return RendererCommands;
}
if (_disposed)
@@ -878,7 +856,6 @@ namespace Emby.Dlna.PlayTo
}
var avService = GetServiceRenderingControl();
if (avService == null)
{
throw new ArgumentException("Device AvService is null");
@@ -890,9 +867,8 @@ namespace Emby.Dlna.PlayTo
_logger.LogDebug("Dlna Device.GetRenderingProtocolAsync");
var document = await httpClient.GetDataAsync(url, cancellationToken).ConfigureAwait(false);
rendererCommands = TransportCommands.Create(document);
RendererCommands = rendererCommands;
return rendererCommands;
RendererCommands = TransportCommands.Create(document);
return RendererCommands;
}
private string NormalizeUrl(string baseUrl, string url)
@@ -904,85 +880,103 @@ namespace Emby.Dlna.PlayTo
}
if (!url.Contains("/"))
{
url = "/dmr/" + url;
}
if (!url.StartsWith("/"))
{
url = "/" + url;
}
return baseUrl + url;
}
private TransportCommands AvCommands
{
get;
set;
}
private TransportCommands AvCommands { get; set; }
private TransportCommands RendererCommands
{
get;
set;
}
private TransportCommands RendererCommands { get; set; }
public static async Task<Device> CreateuPnpDeviceAsync(Uri url, IHttpClient httpClient, IServerConfigurationManager config, ILogger logger, ITimerFactory timerFactory, CancellationToken cancellationToken)
public static async Task<Device> CreateuPnpDeviceAsync(Uri url, IHttpClient httpClient, IServerConfigurationManager config, ILogger logger, CancellationToken cancellationToken)
{
var ssdpHttpClient = new SsdpHttpClient(httpClient, config);
var document = await ssdpHttpClient.GetDataAsync(url.ToString(), cancellationToken).ConfigureAwait(false);
var deviceProperties = new DeviceInfo();
var friendlyNames = new List<string>();
var name = document.Descendants(uPnpNamespaces.ud.GetName("friendlyName")).FirstOrDefault();
if (name != null && !string.IsNullOrWhiteSpace(name.Value))
{
friendlyNames.Add(name.Value);
}
var room = document.Descendants(uPnpNamespaces.ud.GetName("roomName")).FirstOrDefault();
if (room != null && !string.IsNullOrWhiteSpace(room.Value))
{
friendlyNames.Add(room.Value);
}
deviceProperties.Name = string.Join(" ", friendlyNames.ToArray());
var deviceProperties = new DeviceInfo()
{
Name = string.Join(" ", friendlyNames),
BaseUrl = string.Format("http://{0}:{1}", url.Host, url.Port)
};
var model = document.Descendants(uPnpNamespaces.ud.GetName("modelName")).FirstOrDefault();
if (model != null)
{
deviceProperties.ModelName = model.Value;
}
var modelNumber = document.Descendants(uPnpNamespaces.ud.GetName("modelNumber")).FirstOrDefault();
if (modelNumber != null)
{
deviceProperties.ModelNumber = modelNumber.Value;
}
var uuid = document.Descendants(uPnpNamespaces.ud.GetName("UDN")).FirstOrDefault();
if (uuid != null)
{
deviceProperties.UUID = uuid.Value;
}
var manufacturer = document.Descendants(uPnpNamespaces.ud.GetName("manufacturer")).FirstOrDefault();
if (manufacturer != null)
{
deviceProperties.Manufacturer = manufacturer.Value;
}
var manufacturerUrl = document.Descendants(uPnpNamespaces.ud.GetName("manufacturerURL")).FirstOrDefault();
if (manufacturerUrl != null)
{
deviceProperties.ManufacturerUrl = manufacturerUrl.Value;
}
var presentationUrl = document.Descendants(uPnpNamespaces.ud.GetName("presentationURL")).FirstOrDefault();
if (presentationUrl != null)
{
deviceProperties.PresentationUrl = presentationUrl.Value;
}
var modelUrl = document.Descendants(uPnpNamespaces.ud.GetName("modelURL")).FirstOrDefault();
if (modelUrl != null)
{
deviceProperties.ModelUrl = modelUrl.Value;
}
var serialNumber = document.Descendants(uPnpNamespaces.ud.GetName("serialNumber")).FirstOrDefault();
if (serialNumber != null)
{
deviceProperties.SerialNumber = serialNumber.Value;
}
var modelDescription = document.Descendants(uPnpNamespaces.ud.GetName("modelDescription")).FirstOrDefault();
if (modelDescription != null)
{
deviceProperties.ModelDescription = modelDescription.Value;
deviceProperties.BaseUrl = String.Format("http://{0}:{1}", url.Host, url.Port);
}
var icon = document.Descendants(uPnpNamespaces.ud.GetName("icon")).FirstOrDefault();
if (icon != null)
{
deviceProperties.Icon = CreateIcon(icon);
@@ -991,12 +985,15 @@ namespace Emby.Dlna.PlayTo
foreach (var services in document.Descendants(uPnpNamespaces.ud.GetName("serviceList")))
{
if (services == null)
{
continue;
}
var servicesList = services.Descendants(uPnpNamespaces.ud.GetName("service"));
if (servicesList == null)
{
continue;
}
foreach (var element in servicesList)
{
@@ -1009,9 +1006,7 @@ namespace Emby.Dlna.PlayTo
}
}
var device = new Device(deviceProperties, httpClient, logger, config, timerFactory);
return device;
return new Device(deviceProperties, httpClient, logger, config);
}
#endregion
@@ -1021,7 +1016,7 @@ namespace Emby.Dlna.PlayTo
{
if (element == null)
{
throw new ArgumentNullException("element");
throw new ArgumentNullException(nameof(element));
}
var mimeType = element.GetDescendantValue(uPnpNamespaces.ud.GetName("mimetype"));
@@ -1098,13 +1093,10 @@ namespace Emby.Dlna.PlayTo
private void OnPlaybackStart(uBaseObject mediaInfo)
{
if (PlaybackStart != null)
PlaybackStart?.Invoke(this, new PlaybackStartEventArgs
{
PlaybackStart.Invoke(this, new PlaybackStartEventArgs
{
MediaInfo = mediaInfo
});
}
MediaInfo = mediaInfo
});
}
private void OnPlaybackProgress(uBaseObject mediaInfo)
@@ -1115,65 +1107,63 @@ namespace Emby.Dlna.PlayTo
return;
}
if (PlaybackProgress != null)
PlaybackProgress?.Invoke(this, new PlaybackProgressEventArgs
{
PlaybackProgress.Invoke(this, new PlaybackProgressEventArgs
{
MediaInfo = mediaInfo
});
}
MediaInfo = mediaInfo
});
}
private void OnPlaybackStop(uBaseObject mediaInfo)
{
if (PlaybackStopped != null)
PlaybackStopped?.Invoke(this, new PlaybackStoppedEventArgs
{
PlaybackStopped.Invoke(this, new PlaybackStoppedEventArgs
{
MediaInfo = mediaInfo
});
}
MediaInfo = mediaInfo
});
}
private void OnMediaChanged(uBaseObject old, uBaseObject newMedia)
{
if (MediaChanged != null)
MediaChanged?.Invoke(this, new MediaChangedEventArgs
{
MediaChanged.Invoke(this, new MediaChangedEventArgs
{
OldMediaInfo = old,
NewMediaInfo = newMedia
});
}
OldMediaInfo = old,
NewMediaInfo = newMedia
});
}
#region IDisposable
bool _disposed;
public void Dispose()
{
if (!_disposed)
{
_disposed = true;
DisposeTimer();
}
Dispose(true);
GC.SuppressFinalize(this);
}
private void DisposeTimer()
protected virtual void Dispose(bool disposing)
{
if (_timer != null)
if (_disposed)
{
_timer.Dispose();
_timer = null;
return;
}
if (disposing)
{
_timer?.Dispose();
}
_timer = null;
Properties = null;
_disposed = true;
}
#endregion
public override string ToString()
{
return String.Format("{0} - {1}", Properties.Name, Properties.BaseUrl);
return string.Format("{0} - {1}", Properties.Name, Properties.BaseUrl);
}
}
}

View File

@@ -1,6 +1,6 @@
using Emby.Dlna.Common;
using MediaBrowser.Model.Dlna;
using System.Collections.Generic;
using Emby.Dlna.Common;
using MediaBrowser.Model.Dlna;
namespace Emby.Dlna.PlayTo
{
@@ -34,26 +34,14 @@ namespace Emby.Dlna.PlayTo
private string _baseUrl = string.Empty;
public string BaseUrl
{
get
{
return _baseUrl;
}
set
{
_baseUrl = value;
}
get => _baseUrl;
set => _baseUrl = value;
}
public DeviceIcon Icon { get; set; }
private readonly List<DeviceService> _services = new List<DeviceService>();
public List<DeviceService> Services
{
get
{
return _services;
}
}
public List<DeviceService> Services => _services;
public DeviceIdentification ToDeviceIdentification()
{

View File

@@ -1,28 +1,25 @@
using MediaBrowser.Controller.Dlna;
using MediaBrowser.Controller.Drawing;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Session;
using Emby.Dlna.Didl;
using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using Microsoft.Extensions.Logging;
using MediaBrowser.Model.Session;
using MediaBrowser.Model.System;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Emby.Dlna.Didl;
using MediaBrowser.Common.Configuration;
using MediaBrowser.Controller.Dlna;
using MediaBrowser.Controller.Drawing;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.MediaEncoding;
using MediaBrowser.Controller.Session;
using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Events;
using MediaBrowser.Model.Globalization;
using MediaBrowser.Model.Extensions;
using System.Net.Http;
using MediaBrowser.Model.Services;
using MediaBrowser.Model.Session;
using Microsoft.Extensions.Logging;
namespace Emby.Dlna.PlayTo
{
@@ -45,39 +42,43 @@ namespace Emby.Dlna.PlayTo
private readonly IDeviceDiscovery _deviceDiscovery;
private readonly string _serverAddress;
private readonly string _accessToken;
private readonly DateTime _creationTime;
public bool IsSessionActive
{
get
{
return !_disposed && _device != null;
}
}
public bool IsSessionActive => !_disposed && _device != null;
public bool SupportsMediaControl
{
get { return IsSessionActive; }
}
public bool SupportsMediaControl => IsSessionActive;
public PlayToController(SessionInfo session, ISessionManager sessionManager, ILibraryManager libraryManager, ILogger logger, IDlnaManager dlnaManager, IUserManager userManager, IImageProcessor imageProcessor, string serverAddress, string accessToken, IDeviceDiscovery deviceDiscovery, IUserDataManager userDataManager, ILocalizationManager localization, IMediaSourceManager mediaSourceManager, IConfigurationManager config, IMediaEncoder mediaEncoder)
public PlayToController(
SessionInfo session,
ISessionManager sessionManager,
ILibraryManager libraryManager,
ILogger logger,
IDlnaManager dlnaManager,
IUserManager userManager,
IImageProcessor imageProcessor,
string serverAddress,
string accessToken,
IDeviceDiscovery deviceDiscovery,
IUserDataManager userDataManager,
ILocalizationManager localization,
IMediaSourceManager mediaSourceManager,
IConfigurationManager config,
IMediaEncoder mediaEncoder)
{
_session = session;
_sessionManager = sessionManager;
_libraryManager = libraryManager;
_logger = logger;
_dlnaManager = dlnaManager;
_userManager = userManager;
_imageProcessor = imageProcessor;
_serverAddress = serverAddress;
_accessToken = accessToken;
_deviceDiscovery = deviceDiscovery;
_userDataManager = userDataManager;
_localization = localization;
_mediaSourceManager = mediaSourceManager;
_config = config;
_mediaEncoder = mediaEncoder;
_accessToken = accessToken;
_logger = logger;
_creationTime = DateTime.UtcNow;
}
public void Init(Device device)
@@ -110,14 +111,11 @@ namespace Emby.Dlna.PlayTo
{
var info = e.Argument;
string nts;
info.Headers.TryGetValue("NTS", out nts);
info.Headers.TryGetValue("NTS", out string nts);
string usn;
if (!info.Headers.TryGetValue("USN", out usn)) usn = String.Empty;
if (!info.Headers.TryGetValue("USN", out string usn)) usn = string.Empty;
string nt;
if (!info.Headers.TryGetValue("NT", out nt)) nt = String.Empty;
if (!info.Headers.TryGetValue("NT", out string nt)) nt = string.Empty;
if (usn.IndexOf(_device.Properties.UUID, StringComparison.OrdinalIgnoreCase) != -1 &&
!_disposed)
@@ -389,9 +387,7 @@ namespace Emby.Dlna.PlayTo
return _device.IsPaused ? _device.SetPlay(CancellationToken.None) : _device.SetPause(CancellationToken.None);
case PlaystateCommand.Seek:
{
return Seek(command.SeekPositionTicks ?? 0);
}
return Seek(command.SeekPositionTicks ?? 0);
case PlaystateCommand.NextTrack:
return SetPlaylistIndex(_currentPlaylistIndex + 1);
@@ -439,13 +435,7 @@ namespace Emby.Dlna.PlayTo
private int _currentPlaylistIndex;
private readonly List<PlaylistItem> _playlist = new List<PlaylistItem>();
private List<PlaylistItem> Playlist
{
get
{
return _playlist;
}
}
private List<PlaylistItem> Playlist => _playlist;
private void AddItemFromId(Guid id, List<BaseItem> list)
{
@@ -463,8 +453,7 @@ namespace Emby.Dlna.PlayTo
var profile = _dlnaManager.GetProfile(deviceInfo.ToDeviceIdentification()) ??
_dlnaManager.GetDefaultProfile();
var hasMediaSources = item as IHasMediaSources;
var mediaSources = hasMediaSources != null
var mediaSources = item is IHasMediaSources
? (_mediaSourceManager.GetStaticMediaSources(item, true, user))
: new List<MediaSourceInfo>();
@@ -473,7 +462,7 @@ namespace Emby.Dlna.PlayTo
playlistItem.StreamUrl = DidlBuilder.NormalizeDlnaMediaUrl(playlistItem.StreamInfo.ToUrl(_serverAddress, _accessToken));
var itemXml = new DidlBuilder(profile, user, _imageProcessor, _serverAddress, _accessToken, _userDataManager, _localization, _mediaSourceManager, _logger, _libraryManager, _mediaEncoder)
var itemXml = new DidlBuilder(profile, user, _imageProcessor, _serverAddress, _accessToken, _userDataManager, _localization, _mediaSourceManager, _logger, _mediaEncoder)
.GetItemDidl(_config.GetDlnaConfiguration(), item, user, null, _session.DeviceId, new Filter(), playlistItem.StreamInfo);
playlistItem.Didl = itemXml;
@@ -641,9 +630,7 @@ namespace Emby.Dlna.PlayTo
private Task SendGeneralCommand(GeneralCommand command, CancellationToken cancellationToken)
{
GeneralCommandType commandType;
if (Enum.TryParse(command.Name, true, out commandType))
if (Enum.TryParse(command.Name, true, out GeneralCommandType commandType))
{
switch (commandType)
{
@@ -659,13 +646,9 @@ namespace Emby.Dlna.PlayTo
return _device.ToggleMute(cancellationToken);
case GeneralCommandType.SetAudioStreamIndex:
{
string arg;
if (command.Arguments.TryGetValue("Index", out arg))
if (command.Arguments.TryGetValue("Index", out string arg))
{
int val;
if (int.TryParse(arg, NumberStyles.Integer, _usCulture, out val))
if (int.TryParse(arg, NumberStyles.Integer, _usCulture, out var val))
{
return SetAudioStreamIndex(val);
}
@@ -677,13 +660,9 @@ namespace Emby.Dlna.PlayTo
}
case GeneralCommandType.SetSubtitleStreamIndex:
{
string arg;
if (command.Arguments.TryGetValue("Index", out arg))
if (command.Arguments.TryGetValue("Index", out string arg))
{
int val;
if (int.TryParse(arg, NumberStyles.Integer, _usCulture, out val))
if (int.TryParse(arg, NumberStyles.Integer, _usCulture, out var val))
{
return SetSubtitleStreamIndex(val);
}
@@ -695,13 +674,9 @@ namespace Emby.Dlna.PlayTo
}
case GeneralCommandType.SetVolume:
{
string arg;
if (command.Arguments.TryGetValue("Volume", out arg))
if (command.Arguments.TryGetValue("Volume", out string arg))
{
int volume;
if (int.TryParse(arg, NumberStyles.Integer, _usCulture, out volume))
if (int.TryParse(arg, NumberStyles.Integer, _usCulture, out var volume))
{
return _device.SetVolume(volume, cancellationToken);
}
@@ -829,7 +804,7 @@ namespace Emby.Dlna.PlayTo
{
if (string.IsNullOrEmpty(url))
{
throw new ArgumentNullException("url");
throw new ArgumentNullException(nameof(url));
}
var parts = url.Split('/');
@@ -855,7 +830,7 @@ namespace Emby.Dlna.PlayTo
{
if (string.IsNullOrEmpty(url))
{
throw new ArgumentNullException("url");
throw new ArgumentNullException(nameof(url));
}
var request = new StreamParams
@@ -896,8 +871,7 @@ namespace Emby.Dlna.PlayTo
{
var value = values.Get(name);
int result;
if (int.TryParse(value, NumberStyles.Integer, CultureInfo.InvariantCulture, out result))
if (int.TryParse(value, NumberStyles.Integer, CultureInfo.InvariantCulture, out var result))
{
return result;
}
@@ -909,8 +883,7 @@ namespace Emby.Dlna.PlayTo
{
var value = values.Get(name);
long result;
if (long.TryParse(value, NumberStyles.Integer, CultureInfo.InvariantCulture, out result))
if (long.TryParse(value, NumberStyles.Integer, CultureInfo.InvariantCulture, out var result))
{
return result;
}

View File

@@ -1,26 +1,22 @@
using MediaBrowser.Common.Net;
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Common.Extensions;
using MediaBrowser.Common.Net;
using MediaBrowser.Controller;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Dlna;
using MediaBrowser.Controller.Drawing;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Session;
using Microsoft.Extensions.Logging;
using MediaBrowser.Model.Session;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
using MediaBrowser.Controller.MediaEncoding;
using MediaBrowser.Controller.Session;
using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Events;
using MediaBrowser.Model.Globalization;
using MediaBrowser.Model.Net;
using MediaBrowser.Model.Threading;
using System.Threading;
using MediaBrowser.Common.Extensions;
using MediaBrowser.Controller.Devices;
using MediaBrowser.Model.Session;
using Microsoft.Extensions.Logging;
namespace Emby.Dlna.PlayTo
{
@@ -42,13 +38,12 @@ namespace Emby.Dlna.PlayTo
private readonly IDeviceDiscovery _deviceDiscovery;
private readonly IMediaSourceManager _mediaSourceManager;
private readonly IMediaEncoder _mediaEncoder;
private readonly ITimerFactory _timerFactory;
private bool _disposed;
private SemaphoreSlim _sessionLock = new SemaphoreSlim(1, 1);
private CancellationTokenSource _disposeCancellationTokenSource = new CancellationTokenSource();
public PlayToManager(ILogger logger, ISessionManager sessionManager, ILibraryManager libraryManager, IUserManager userManager, IDlnaManager dlnaManager, IServerApplicationHost appHost, IImageProcessor imageProcessor, IDeviceDiscovery deviceDiscovery, IHttpClient httpClient, IServerConfigurationManager config, IUserDataManager userDataManager, ILocalizationManager localization, IMediaSourceManager mediaSourceManager, IMediaEncoder mediaEncoder, ITimerFactory timerFactory)
public PlayToManager(ILogger logger, ISessionManager sessionManager, ILibraryManager libraryManager, IUserManager userManager, IDlnaManager dlnaManager, IServerApplicationHost appHost, IImageProcessor imageProcessor, IDeviceDiscovery deviceDiscovery, IHttpClient httpClient, IServerConfigurationManager config, IUserDataManager userDataManager, ILocalizationManager localization, IMediaSourceManager mediaSourceManager, IMediaEncoder mediaEncoder)
{
_logger = logger;
_sessionManager = sessionManager;
@@ -64,7 +59,6 @@ namespace Emby.Dlna.PlayTo
_localization = localization;
_mediaSourceManager = mediaSourceManager;
_mediaEncoder = mediaEncoder;
_timerFactory = timerFactory;
}
public void Start()
@@ -81,11 +75,9 @@ namespace Emby.Dlna.PlayTo
var info = e.Argument;
string usn;
if (!info.Headers.TryGetValue("USN", out usn)) usn = string.Empty;
if (!info.Headers.TryGetValue("USN", out string usn)) usn = string.Empty;
string nt;
if (!info.Headers.TryGetValue("NT", out nt)) nt = string.Empty;
if (!info.Headers.TryGetValue("NT", out string nt)) nt = string.Empty;
string location = info.Location.ToString();
@@ -97,11 +89,6 @@ namespace Emby.Dlna.PlayTo
return;
}
if (_sessionManager.Sessions.Any(i => usn.IndexOf(i.DeviceId, StringComparison.OrdinalIgnoreCase) != -1))
{
return;
}
var cancellationToken = _disposeCancellationTokenSource.Token;
await _sessionLock.WaitAsync(cancellationToken).ConfigureAwait(false);
@@ -113,6 +100,11 @@ namespace Emby.Dlna.PlayTo
return;
}
if (_sessionManager.Sessions.Any(i => usn.IndexOf(i.DeviceId, StringComparison.OrdinalIgnoreCase) != -1))
{
return;
}
await AddDevice(info, location, cancellationToken).ConfigureAwait(false);
}
catch (OperationCanceledException)
@@ -158,8 +150,7 @@ namespace Emby.Dlna.PlayTo
_logger.LogDebug("Attempting to create PlayToController from location {0}", location);
_logger.LogDebug("Logging session activity from location {0}", location);
string uuid;
if (info.Headers.TryGetValue("USN", out uuid))
if (info.Headers.TryGetValue("USN", out string uuid))
{
uuid = GetUuid(uuid);
}
@@ -168,17 +159,15 @@ namespace Emby.Dlna.PlayTo
uuid = location.GetMD5().ToString("N");
}
string deviceName = null;
var sessionInfo = _sessionManager.LogSessionActivity("DLNA", _appHost.ApplicationVersion.ToString(), uuid, deviceName, uri.OriginalString, null);
var sessionInfo = _sessionManager.LogSessionActivity("DLNA", _appHost.ApplicationVersion, uuid, null, uri.OriginalString, null);
var controller = sessionInfo.SessionControllers.OfType<PlayToController>().FirstOrDefault();
if (controller == null)
{
var device = await Device.CreateuPnpDeviceAsync(uri, _httpClient, _config, _logger, _timerFactory, cancellationToken).ConfigureAwait(false);
var device = await Device.CreateuPnpDeviceAsync(uri, _httpClient, _config, _logger, cancellationToken).ConfigureAwait(false);
deviceName = device.Properties.Name;
string deviceName = device.Properties.Name;
_sessionManager.UpdateDeviceName(sessionInfo.Id, deviceName);
@@ -192,8 +181,6 @@ namespace Emby.Dlna.PlayTo
serverAddress = _appHost.GetLocalApiUrl(info.LocalIpAddress);
}
string accessToken = null;
controller = new PlayToController(sessionInfo,
_sessionManager,
_libraryManager,
@@ -202,7 +189,7 @@ namespace Emby.Dlna.PlayTo
_userManager,
_imageProcessor,
serverAddress,
accessToken,
null,
_deviceDiscovery,
_userDataManager,
_localization,

View File

@@ -1,4 +1,4 @@
using System;
using System;
namespace Emby.Dlna.PlayTo
{
@@ -6,4 +6,4 @@ namespace Emby.Dlna.PlayTo
{
public uBaseObject MediaInfo { get; set; }
}
}
}

View File

@@ -1,4 +1,4 @@
using System;
using System;
namespace Emby.Dlna.PlayTo
{

View File

@@ -1,4 +1,4 @@
using System;
using System;
namespace Emby.Dlna.PlayTo
{
@@ -12,4 +12,4 @@ namespace Emby.Dlna.PlayTo
public uBaseObject OldMediaInfo { get; set; }
public uBaseObject NewMediaInfo { get; set; }
}
}
}

View File

@@ -1,4 +1,4 @@
using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Dlna;
namespace Emby.Dlna.PlayTo
{
@@ -12,4 +12,4 @@ namespace Emby.Dlna.PlayTo
public DeviceProfile Profile { get; set; }
}
}
}

View File

@@ -1,10 +1,9 @@
using MediaBrowser.Controller.Entities;
using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Session;
using System;
using System.Globalization;
using System.IO;
using System.Linq;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Session;
namespace Emby.Dlna.PlayTo
{
@@ -49,7 +48,7 @@ namespace Emby.Dlna.PlayTo
return playlistItem;
}
private bool IsSupported(DirectPlayProfile profile, Photo item)
private static bool IsSupported(DirectPlayProfile profile, Photo item)
{
var mediaPath = item.Path;

Some files were not shown because too many files have changed in this diff Show More