1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-03-06 13:31:28 -05:00

Compare commits

..

412 Commits

Author SHA1 Message Date
Qstick
748e846c21 Delete appveyor.yml 2020-07-20 19:23:38 -04:00
Qstick
6b52d11577 Don't fail test if there are no builds with changes shown 2020-07-20 14:23:09 +01:00
ta264
62a0454bf7 Remove cruft 2020-07-20 14:23:09 +01:00
ta264
deddb0ac6c Fix update folder definition 2020-07-20 14:23:09 +01:00
Qstick
923b959b6c Build on Azure instead of Appveyor (#4590)
* Build on Azure instead of Appveyor

* fixup! Update Nuget

* fixup! installer and tests

* fixup! automation tests mac/linux

* Fix .gitattributes

* Fix line endings

* Try to fix integration tests

* Install mediainfo

* Update sqlite3 binaries for windows and mac

* Update media info to 20.03 and fix test

* Fix HttpClientTests, Use Servarr HttpBin Mirror

* Update test script

* Add media info to tests

* Fix tests

* Ignore tests ignored on Aphrodite

* partial automation update

* Reveet mac mediaInfo upgrade

* fixup! automation tests

* Revert "Reveet mac mediaInfo upgrade"

This reverts commit b54a76446b.

* Don't run linux tests on mac

* Exclude test failing on mac

Co-authored-by: ta264 <ta264@users.noreply.github.com>
2020-07-15 18:31:50 -04:00
Qstick
b088a2220a Fixed: Mark "BAD" Nzbget Downloads as Failed 2020-07-02 22:31:27 -04:00
Qstick
e29e962bd5 Fixed: Mac Update to another 0.X package 2020-06-25 21:14:24 -04:00
Qstick
62173c5258 Fixed: NetImport Tries to Add Existing Movies
Fixes #4170
2020-06-20 01:28:58 -04:00
Qstick
e3bb4d9b59 Fixed: Don't use staging API for Nightly, It's Down 2020-06-20 01:13:52 -04:00
ta264
e973701f1c Make macOS updater executable before running it 2020-06-12 14:29:52 -04:00
Qstick
62efca5084 Handle V3 Update Folder 2020-06-12 14:29:52 -04:00
Qstick
f638278f4e Switch Update Server to Lidarr Hosted 2020-06-12 14:29:52 -04:00
Patrick Koenig
69811b1291 Add crossorigin use-credentials attribute to manifest tag 2020-06-06 18:54:23 -04:00
DavidSpek
802e5ac151 Added Dolby Digital Plus with Atmos (#3902)
* Added Dolby Digital Plus with Atmos

Added Dolby Digital Plus with Atmos by checking the codec additional features for JOC, which stands for Joint Object Coding and is the technique used for adding Atmos metadata to Dolby Digital Plus audio streams. This is similar to the 16-ch additional feature used to distinguish Atmos in a TrueHD audio stream.

* Corrected positioning of EAC3 Atmos

* Changed the formatting from aphrodite to dapper

"splitAdditionalFeatures.ContainsIgnoreCase" was changed to "audioAdditionalFeatures =="

* Removed White Space at the end of line 176
2020-05-30 00:27:04 -04:00
ta264
09fe1bfc96 Fixed: CustomFormat size specs in already grabbed check
Sizes need to be parsed as a long not an int else anything with a size
> 2GiB will fail to be parsed and be set with size 0

Fixes #4262
2020-05-13 18:01:24 +01:00
ta264
1dd0df58ca Update gitignore 2020-05-13 18:01:24 +01:00
Qstick
747f4c87d3 New: Ignore #recycle folders (Synology Recycle bin folder) 2020-04-05 10:26:59 -04:00
Sean Godsell
ac2b9516e1 Fixed: Made Username required for UserCustomList (#4255) 2020-03-31 20:47:31 -04:00
Qstick
1f72e1de74 Fixed: Populate Info in Lookup Results if Existing Movie
Fixes #4152
2020-02-16 21:41:03 -05:00
desimaniac
6b743439eb New: Add Year to Custom Script (#4115) 2020-02-10 18:54:25 -05:00
Jonas Stendahl
b254ee548d Fixed: IMDb ID handling for Torznab indexers (#4089)
* Fix IMDb IDs

* Fix type errors

* Attribute is named imdb

* Use TryParse instead

* Use TryParse properly

* Pass out keyword

* Use variable instead of property
2020-02-10 18:53:22 -05:00
devbrian
d8e0fa6ac2 New: Add Release Date and Cinema Date to Custom Script (#4109)
New: Add Release Date and Cinema Date to Custom Script (Backport aphrodite)
2020-01-30 19:42:55 -05:00
Qstick
bdb4f490b9 Fixed: Add to AddIfNotNull for Images 2020-01-20 21:19:01 -05:00
Qstick
588771f3ee Fixed: Don't store image is null from TMDB 2020-01-20 21:11:45 -05:00
Qstick
f0ef6c3601 Fixed: Improve Logging, Slowdown startup if non-recoverable errors 2020-01-19 18:34:43 -05:00
Qstick
01b0365884 New: Add Sentry 2020-01-18 22:18:01 -05:00
Qstick
e715905ea1 New: Remove LogEntries 2020-01-18 22:18:01 -05:00
Qstick
5d4ec1272d Fixed: Allow spaces in Trakt username and listname 2020-01-18 13:34:49 -05:00
Fossil
2d40914482 New: Added UHD, X265, WEB-DL etc. to NZB Finder (#3568)
* Added UHD, X265, WEB-DL etc. to NZB Finder

This works for Sonarr, can Radarr also add custom categories like this?

* Remove root and foreign categories for NZB Finder

As discussed https://github.com/Radarr/Radarr/pull/3568

* Remove duplicate preset
2020-01-11 11:40:25 -05:00
Qstick
420e5fd730 New: Fallback to tmdb search on Rarbg if IMDb is null 2019-12-28 20:54:40 -05:00
Qstick
b95c2e5c8b Fixed: Catch NullRef On HDBits request if IMDB empty 2019-12-28 20:54:15 -05:00
Pika
7ddc8d416c Fixed: Use Download Client name for grabbed history events 2019-12-18 22:33:51 -05:00
Qstick
6160bbf113 New: Add digits to Deluge's category validator
Fixed #3910
2019-12-16 20:23:28 -05:00
Qstick
a2f666445f Revert "Fixed: .srt files in subfolders are not being imported (#3647)"
This reverts commit c27f08738a.
2019-12-12 16:58:05 -05:00
Lord-Lux
92d6e81236 Fixed: RARBG URL Scheme (#3765)
* Update RarbgParser.cs

* Update RarbgFixture.cs
2019-12-09 23:29:21 -05:00
tsubus
227101d59e Fixed: Typo in LogentriesCore.csproj (#3936)
Linux could not find ConfigurationManager due to case-sensitivity,
failing to build
2019-12-09 22:42:51 -05:00
Rick van Hattem
080d0a9b04 New: Added links to wiki and examples from add/edit custom tags dialog 2019-11-24 00:37:41 -05:00
Pierre Spring
1b58ae7d47 Fixed: open links in new tab on meta click (#3831)
This adds support to open links in new tabs for all the operating
systems.

Fixes #3830
2019-11-03 21:45:24 -05:00
Jef LeCompte
a5e2e5777c Fixed: Added qBittorent state 'moving' (#3847)
* Added qBittorent state 'moving'

The state 'moving' wasn't being recording in Radarr, so it would show up
as a warning.

* Updated unknown state to be info
2019-11-03 21:42:54 -05:00
Rick van Hattem
ddc2b42923 Fixed: link to the custom format examples (#3785) 2019-10-23 21:03:27 -04:00
Matthew Jacques
3ac3737de9 Fixed: Replaced episode with movie in UpgradeSpecification (#3805) 2019-10-11 14:49:43 -04:00
Qstick
01ad015b14 Changed: Regenerate package.json for secondary package updates (#3750) 2019-09-08 23:05:16 -04:00
Qstick
3d57d5aba7 Fixed: qBit V2 and metaDL Support 2019-09-06 09:59:19 -04:00
Qstick
d65fe3a530 Fixed: Integration Test Failing CircleCi 2019-09-06 09:59:19 -04:00
Qstick
e100759e71 New: Platform Updates, Socket Closure Workaround 2019-09-06 09:59:19 -04:00
Qstick
df068e9f0a Fixed: TMDB Failing due to missing response header (#3610) 2019-09-01 11:55:33 -04:00
jpogs
c27f08738a Fixed: .srt files in subfolders are not being imported (#3647)
* Fixed #1958
- extra file module will search for any subfolder and filename
- fixed language parser to match RARBG format
- Add .srt subs according to level of details such that higher detailed sub gets loaded to media player first

* Fixed Code Factor issue on SubtitleService.cs:104

* Fixed: issues on unit test for TV subs; added test cases for RARBG movie subs

* Updated RARBG parser so it won't match movie title format

* Cleaned up code for review

* Update SubtitleService.cs
2019-09-01 11:53:40 -04:00
rubasace
61629a527c Fixed: Parse UHDRemux as Remux and not as WEB-DL (#3696)
* Parse UHDRemux as Remux and not as WEB-DL

* Add test case for UHDRemux parsing
2019-09-01 11:46:09 -04:00
desimaniac
5291f42905 New: Added repost exclusions to CleanReleaseGroupRegex (#3720) 2019-09-01 11:39:27 -04:00
Qstick
0ce5857094 Fixed: Wanted Cutoff Page filters (#3611)
* Fixed: Cutoff Filters Broken

* Fixed: Wanted Filters Broken

* Fixed: CutoffUnmet Integration Tests

* Really fixed CutoffUnmet Integration tests.

* Added: Some more integration tests for CutoffUnmet

* Fixed: Integration tests for MissingFixture.
2019-07-10 18:12:30 -04:00
FuNK3Y
443078a7e4 Added: Ability to set categories for search for RARBG (#3544)
Also fixes an issue where the rargb movie category would not actually contain all movie categories. Fixes #3543
2019-07-10 10:41:58 +02:00
Kyrylo Mikos
dbdda0da13 Added: Support for Ukrainian language. (#3594) 2019-07-10 10:38:55 +02:00
Leonardo Galli
b5e1b83de3 Fixed: All integration tests and some code which was wrong. (#3604)
* Fixed: All integration tests and some code which was wrong.

* Hopefully fix Movie Fixture issues.

* Fixed: HttpFixture. Took commit from sonarr.
2019-07-08 00:45:52 +02:00
Leonardo Galli
8e43f5c4ae Fixed: When refreshing info about a movie, the alt titles should now correctly be deleted / updated, even from TMDB. (#3603)
* Fixed: When refreshing info about a movie, the alt titles should now correctly be deleted / updated, even from TMDB.
Fixes #3542

* Fixed: Small things fixup.
2019-07-08 00:15:35 +02:00
Mike S
e6d3954e79 Update to work with Deluge v2 (#3577) 2019-06-21 18:36:27 -04:00
Daniel Dammermann
61066cb6cf Fixed: Library shown as empty after filter returns no movies and page is refreshed (#3515)
Fixes #3514
2019-05-30 20:31:31 +02:00
Leonardo Galli
2f76f3c6b6 Create FUNDING.yml 2019-05-30 00:34:57 +02:00
Leonardo Galli
7756b03555 Fixed: a after a shortened word is not removed correctly for matching. Fixes ##3487 2019-05-02 13:18:28 +02:00
Leonardo Galli
5faaffc9c6 @cosmetic updated changelog 2019-05-02 13:05:35 +02:00
Ricardo Amaral
7a43bf3f60 Added: Tags support to NetImport (Lists) (#3127)
* Add tags support to NetImport (Lists)

* Keep indentation consistent with current code

* Initialize set of empty tags

* Add tags from list to movie

* Prevent tags used by lists from being removed
2019-05-02 12:57:40 +02:00
RhinoRhys
84fab25af7 Changed: Improved templates for h264 & h265 custom formats (#3432)
* Update CustomFormatService.cs

resolves #3419

* Update CustomFormatService.cs

* Update CustomFormatService.cs
2019-05-02 12:55:48 +02:00
jwildman16
52520e356d Changed: Logo-256.png to a transparent version so it looks better in Android notifications. (#3479) 2019-05-02 12:55:01 +02:00
Logan
cc44d022b3 Added: Radarr_Download_Id and Radarr_Download_Client to the environment (#3276)
Fixes #3232
2019-05-02 12:52:33 +02:00
Steven Crouchman
f411903e90 New: Allow CheckForFinishedDownloadInterval to be set from the UI (#3233)
* Adding CheckForFinishedDownloadInterval to config service
Changed TaskManager to use a configurable interval for CheckForFinishedDownloadCommand

* Adding new CheckForFinishedDownloadInterval to UI

Fixes #840
2019-05-02 12:51:21 +02:00
stephanrenggli
9985554dcb New: Added support for Gotify notifications (#3474)
* Added support for Gotify notifications

* Use string interpolation to build url

* Adapt changes by markus101 over at Sonarr

* Remove blank line

Fixes #3472
2019-05-02 12:49:21 +02:00
Viserius
f8c009a348 Fixed: Solve ambiguous naming (#3417) 2019-05-02 12:40:51 +02:00
Michael Poutre
da012eb6b5 Fixed: Copy to clipboard not working with calendar feed (#3495)
* Replace flash clipboard implementation with document.execute("copy")

Fixes #3486

* Replace flash clipboard implementation with document.execCommand("copy")

Resolves Radarr/Radarr#3486
2019-05-02 12:38:00 +02:00
RobinQ124274
c79578e99f Added: Remote poster and fanart references to Kodi metadata file (#2837) (#3302)
* Added: Remote poster and fanart references to Kodi metadata file (#2837)

* Added: Null checks to Remote poster and fanart references to Kodi metadata file (#2837)
2019-04-27 19:33:06 -04:00
Leonardo Galli
961fe70cb8 @cosmetic Hopefully fixed nunit randomly failing. (updated nunit and mono) 2019-03-19 11:34:03 +01:00
Qstick
65267af512 Fixed: Edition Tags Not Showing in UI (#3389) 2019-03-19 11:08:15 +01:00
Qstick
ac387f208a Fixed: Support new feed url format IPTorrents (#573) (#3390) 2019-03-19 11:03:40 +01:00
Qstick
80304d8804 New: Support Krypton Kodi Unique Ids (#3388) 2019-03-19 11:03:20 +01:00
Qstick
cafb1a5a45 Changed: Adjust Max Slider Value for Qualities (#3393) 2019-03-19 10:59:57 +01:00
hotio
feef9b1b8d Update README.md (#3409)
Update outdated suitarr info.
2019-03-19 10:56:26 +01:00
Leonardo Galli
4aec27890c Fixed: MediaCovers Race condition which leads to fanart not being downloaded
Fixes #3350
2019-02-24 19:54:02 +01:00
Qstick
58ae4417df Fixed: Cannot Add ITA or ITALIAN custom format (#3385)
Fixes #3253
2019-02-24 18:26:20 +01:00
Qstick
6287bfd9d9 New: Nzb Validation and Nzbget/SAB URLBase (#3380) 2019-02-24 18:16:12 +01:00
Leonardo Galli
5f139c0cb6 Fixed: OsInfo for real this time. 2019-02-24 18:11:42 +01:00
Qstick
6cf257ac01 Fixed: Error in unicode cleanup code removing most non-latin characters instead of just invalid ones. (#3383) 2019-02-24 18:08:28 +01:00
Qstick
5cb5faa8a3 Fixed: Forced Subs not parsed by SubtitleLanguageRegex (#3384)
Fixes #2908
2019-02-24 18:07:48 +01:00
Leonardo Galli
a28f2fd21d Fixed: OsInfo being renamed to PlatformInfo 2019-02-24 18:06:48 +01:00
Qstick
dbf12e1fa4 Fixed: Word Boundary on Edition (#3382) 2019-02-24 18:03:42 +01:00
Václav Slavík
264629cfa5 Fixed: Mis-classification of releases as being Czech (#3378)
After the changes from PR #2948, the regex was too eager to match any
substring contain "SK", such as in "MASK". Fix by requiring word
separation around it, as was already the case with the "CZ" token.
2019-02-24 18:00:04 +01:00
Pieter Janssens
53f49f3b07 Fixed: Match MBluray releases (#3358) 2019-02-24 17:59:25 +01:00
Leonardo Galli
a26016fc08 Fixed: Mono bug causing memory leakage when http connections use gzip compression.
The bug is registered upstream, but this commit works around the problem by doing the gzip decompression separately from the http stack.

Ref #2296
2019-02-24 17:58:19 +01:00
Leonardo Galli
bd969e0bc3 Fixed: Build errors due to dotnet library. 2019-02-24 00:34:23 +01:00
hatharry
3e96fe4a72 Fixed: Emby library update (#3318)
Fixes: #3158
2019-02-18 11:12:34 +01:00
tobsen987
19299ad47f Fixed: Prevent NullRef in CustomScript on Grab for Indexer (#3323)
fixes #3313
2019-02-18 11:10:22 +01:00
Leonardo Galli
8902a3ca44 @cosmetic removed deploy 2019-02-18 11:07:51 +01:00
Leonardo Galli
4015ff08a6 @cosmetic Added Parsing Library: A dotnet library that "exports" our parsing interface. 2019-02-18 00:09:41 +01:00
Leonardo Galli
9bc50749ae Update README.md 2019-01-31 11:41:07 +01:00
Leonardo Galli
34271605c3 @cosmetic Merge pull request #3339 from hotio/patch-2
Update docker link in README
2019-01-31 11:31:26 +01:00
hotio
8272a160d2 Update docker link in README 2019-01-28 10:20:42 +01:00
Leonardo Galli
e7ad09cf62 Fixed: Hopefully fixed sqlite errors when finding by title. 2019-01-10 16:07:41 +01:00
Leonardo Galli
420cbf6dd0 @cosmetic updated changelog. 2019-01-10 08:39:13 +01:00
Leonardo Galli
02eb30b8ee Fixed: A lot of memory issues, such as IDisposable leakage and leaking all the media covers. (#3227)
Thanks again to @Taloth
2019-01-10 08:36:34 +01:00
Leonardo Galli
49b1f2a67d New: Use APIKey & APIUser for authenticating to PassThePopcorn. (#3264) 2018-12-30 14:17:26 +01:00
Swizzy
7c90667965 Added: Support for forcedUP status (#3277)
Also added a warning message upon hitting new unknown states so that they can be handled properly at some point
2018-12-30 14:17:03 +01:00
Leonardo Galli
6d3cff85ae Fixed: Unable to parse movies from 1800s.
Fixes #3271
2018-12-30 13:55:45 +01:00
Leonardo Galli
b9aba5f424 @cosmetic Updated readme to include roadmap. 2018-12-30 13:32:56 +01:00
Leonardo Galli
47b481e797 Fixed: OSX Packages not getting correct version info
Fixes #3274
2018-12-30 13:29:44 +01:00
Taloth Saldono
3ef224ed1d Fixed: Another IDisposable leak when lazy loading properties. 2018-12-26 15:50:06 +01:00
Leonardo Galli
44b1252ecc Fixed: npm start not working with node 10
Fixes #3258
2018-12-24 15:56:53 +01:00
Leonardo Galli
44842a4e6b Fixed: Hopefully fixed issue where a null downloadId or title would cause no downloads to be tracked.
Fixes #3260
2018-12-24 14:49:33 +01:00
Leonardo Galli
cd520b0341 Fixed: MediaCoverService tests and stupidly forgetting to open the database connection for logging. 2018-12-14 18:48:36 +01:00
Leonardo Galli
fed4a0aebe Fixed: MediaCovers resizing potentially leaking memory when concurrently executing. 2018-12-14 09:55:14 +01:00
lps-rocks
ff894d5210 New: rTorrent - Don't start download automatically (#3222) 2018-12-07 11:26:26 +01:00
Qstick
92b5822a39 New: Remove Pre, postbot, xpost suffixes from release groups (#3220) 2018-12-07 11:22:06 +01:00
Qstick
cbdea30a6e New: Secure URLs for Links and Services (#3219) 2018-12-07 11:21:43 +01:00
Qstick
969ef5c515 Fixed: Bump default version to prevent update running from source (#3199) 2018-12-07 11:20:54 +01:00
Qstick
5b52115d68 Fixed: MediaInfo Unit Test Failing due to AudioAdditionalFeatures (#3221) 2018-12-06 12:59:02 +01:00
Leonardo Galli
899bd086ec Fixed: Stream leakage inside CurlHttpDispatcher 2018-12-02 19:24:16 +01:00
Leonardo Galli
d02d71c336 Fixed: Apparently Microsoft thinks that you should cast to IDisposable first. 2018-12-02 19:04:28 +01:00
Leonardo Galli
d4061bd13c Fixed: Invalid SQLite cache size. 2018-12-02 18:22:18 +01:00
Leonardo Galli
c83995adc1 Fixed: Resource leakage inside HttpClient. 2018-12-02 18:16:05 +01:00
Leonardo Galli
df18c34878 Fixed: Typo that could probably lead to an infinite loop. 2018-12-02 18:14:52 +01:00
Leonardo Galli
eb077b043e Fixed: Resource leakage inside ManagedHttpDispatcher. 2018-12-02 18:14:21 +01:00
Leonardo Galli
42015d5d95 Fixed: Leaking of objects when logging something to the database. 2018-12-02 18:12:03 +01:00
Leonardo Galli
09899fcf6c Fixed: DataMapper potentially leaking stuff when being disposed. 2018-12-02 18:10:57 +01:00
Leonardo Galli
8e7b718209 Fixed: DataMapper not being disposed, leading to resource leakage. 2018-12-02 18:10:14 +01:00
Leonardo Galli
d38562664d Fixed: Memory leak due to unmanaged Bitmaps leaking. 2018-12-02 17:59:15 +01:00
Leonardo Galli
77950645af @cosmetic add yarn to circleci image 2018-11-25 01:03:50 +01:00
Leonardo Galli
60a9be71bc @cosmetic fix deploy 2018-11-24 19:54:36 +01:00
Leonardo Galli
49ee288dae @cosmetic forgot this 2018-11-24 19:47:37 +01:00
Leonardo Galli
443995cd93 Merge branch 'develop' of https://github.com/Radarr/Radarr into develop 2018-11-24 19:20:02 +01:00
Leonardo Galli
1456200717 @cosmetic added auto deploy for prs and branch builds 2018-11-24 19:19:53 +01:00
Leonardo Galli
28155b09a0 @cosmetic Hopefully made circle ci artifacts compatible with hotios docker 2018-11-24 16:31:53 +01:00
Leonardo Galli
9ba1d26f05 @cosmetic updated release changelog templates. 2018-11-20 11:18:55 +01:00
Leonardo Galli
e0e531c287 @cosmetic Updated changelog. 2018-11-07 20:59:37 +01:00
Ricardo Amaral
5d0effa591 Fixed: Fallback to 'VideoCodec' if 'VideoFormat' is unavailable (#3142) 2018-11-07 20:57:49 +01:00
Ricardo Amaral
e62b6d1ddb Fixed: Read video 'BitRate_Nominal' if 'BitRate' is empty (#3144) 2018-11-07 20:55:47 +01:00
Leonardo Galli
34c838fdd5 Fixed: UpdateMovieQualityService Tests. 2018-11-07 20:50:00 +01:00
geogolem
4283de1e9e change 64bit mediainfo.dll to 32bit to resolve
issue: https://github.com/Radarr/Radarr/issues/3138
2018-10-31 00:43:01 -04:00
Ricardo Amaral
821653b941 Fixed: Ignore "special drives" from System » Disk Space (#3050)
Fixes #3045, fixes #3122.
2018-10-30 22:07:51 +01:00
Ricardo Amaral
2da1d9f105 Fixed: Tweak style of movie path template on "add movies" screen (#3108) 2018-10-30 22:06:32 +01:00
Ricardo Amaral
97f111bec8 New: Refactor MediaInfo tokens (fixes old tokens adds new stuff) (#3058)
* Rename all 'episodeFile' variables to 'movieFile'

* Improve media info extraction with more fields

* Improve media info tokens extraction

* Add missing fields to MediaInfoModel

* Restore to previous implementation of null handling

* Forgot to add MediaInfoFormatter to project

* Add missing EqualsIgnoreCase extension method

* Simplify Logger.Debug() invocations

* Add missing StartsWithIgnoreCase extension method

* This '.Value' shouldn't be required

* Remove TODO comment

* Upgrade MediaInfo from 17.10 to 18.08.1

* Use correct media info field for files listing

* Replace media info "VideoCodec" (deprecated) with "VideoFormat"

* Fix 'Formatiting' typos

* Add support for media info Format_AdditionalFeatures' field

* Add proper support for all DTS and TrueHD flavors

* Add support for '3D' media info token

* Remove deprecated media info video/audio profile fields

* Add support for 'HDR' media info token

* Add new video parameters to anime file name sample

* Adapt tests for new media info fields

* Revert "Remove deprecated media info video/audio profile fields"

* Include missing test files in core test project

* Fix small regression issue

* Allow sample movie to be detected as HDR

* Do not parse audio channel positions if there are no channels

* Clean up extra blank line

* Reuse already declared variable

* Fix wrong audio channels detection on DTS:X streams

* Fix all failing unit tests

* Fix remaining failing unit tests
2018-10-30 21:44:59 +01:00
Leonardo Galli
4009852c35 Changed: Don't hide custom formats behind advanced settings when editing quality.
Didn't work very well.
2018-10-30 13:20:36 +01:00
Leonardo Galli
a50b74c177 Fixed: Unable to update custom formats for releases with bad Source Titles. 2018-10-30 13:18:46 +01:00
Leonardo Galli
9ea739f6cb @cosmetic Updated Changelog 2018-10-30 11:52:55 +01:00
Leonardo Galli
ad3c01e986 Changed: Upped rate at which we scan the download client. Should reduce cpu and ram usage as well as decrease pressure on download clients.
Also stopped warning about unable to parse a file after warning once. Should decrease ram usage as well and help with bloated log files.
2018-10-30 11:47:54 +01:00
Ricardo Amaral
173b6847e5 Fixed: Do not search movie if unmonitored (#3131) 2018-10-30 11:09:54 +01:00
Ricardo Amaral
07cb844ce6 Changed: Improve model and UI handling for lists. Should finally fix root folder errors. (#3133)
Fixes #3036 (supposedly)
2018-10-30 11:07:35 +01:00
Ricardo Amaral
0783402470 Fixed: Quality badges not being shown on bulk import. (#3121)
Fixes #3106
2018-10-30 11:05:03 +01:00
Leonardo Galli
46e728caf1 @cosmetic Disable failing tests and not used deploy 2018-10-30 11:04:07 +01:00
Lawrence
3b896e9011 Fixed: Trim filename from Kodi movie path before sending library scan request. (#3097) 2018-10-30 11:02:30 +01:00
Justin Kromlinger
623da76d16 Changed: Don't return unmapped folders on rootfolder API call. Massively improves loading time. (#3116) 2018-10-23 11:25:40 +02:00
Jeff Byrnes
95fdf38662 Added: Support for Homebrew-installed mono (#3090) 2018-10-20 19:38:32 +02:00
Leonardo Galli
6c45c7db1b Fixed: Hopefully fixed bulk import not showing files. 2018-10-15 10:03:15 +02:00
Leonardo Galli
e01900628f @cosmetic Updated Changelog 2018-10-15 09:54:53 +02:00
Leonardo Galli
4f4e6c494d Fixed: MPEG-2 remuxes being detected as "Raw-HD" quality
Fixes #2986
2018-10-15 09:54:27 +02:00
Ricardo Amaral
0c542eeb13 Fixed: Allow directory to be parsed similar to past implementation (#3057)
Fixes #3051
2018-10-15 09:43:23 +02:00
Ricardo Amaral
27032a8db3 Fixed: Class names on the 'add movies screen' (#3047) 2018-09-24 16:44:02 +02:00
Ricardo Amaral
31c357fdde Fixed: Use proper cursor for text and linked labels (#3041) 2018-09-24 16:43:43 +02:00
Qstick
ab0bf64273 New: mk3d file format (#2795)
Fixes #1324
2018-09-18 17:25:42 +02:00
cookandy
75b486c6c8 Added: "Add Paused" option to Deluge and Transmission (#3038) 2018-09-18 17:24:55 +02:00
Ricardo Amaral
c566c6e18a Changed: All-around small improvements (#3032) 2018-09-18 17:23:47 +02:00
Leonardo Galli
3767bbec18 Fixed: Donate button requiring two clicks to actually work.
Fixes #2958
2018-09-12 17:18:24 +02:00
Leonardo Galli
e4ba48eb61 @cosmetic Updated Changelog. 2018-09-12 16:50:35 +02:00
halali
057086a630 Added: Czech Language (#2948) 2018-09-12 16:46:57 +02:00
Qstick
2b373f2006 Added: Fallback to Bitrate_Nominal for MediaInfo (#2886)
Fixes #2860
2018-09-12 16:45:54 +02:00
Leonardo Galli
df6f32f6c3 Fixed: Templates for custom format using wrong modifiers. 2018-09-12 16:44:38 +02:00
Leonardo Galli
617c7bae83 Fixed: Profiles always failing validation. 2018-09-11 23:52:07 +02:00
Leonardo Galli
64e8fde0e1 Fixed: ImdbIds not being padded with zeroes, which messes up matching. 2018-09-11 23:47:00 +02:00
Leonardo Galli
0903269b7c Merge remote-tracking branch 'origin/develop' into develop 2018-09-11 23:33:31 +02:00
Leonardo Galli
b2d6ef589f Fixed: Migration would add double underscores for format tags without modifiers. Also fixed Radarr misparsing those tags and added migration to correct this. 2018-09-11 23:33:28 +02:00
Leonardo Galli
354105cf08 Fixed: Issue with custom formats when profile was saved with non existing formats. Also you now don't have to refresh your browser for them to appear / disappear. 2018-09-11 14:35:15 +02:00
Leonardo Galli
bf7689688d Added: All new custom formats 9000! (Rescan old files, delete formats, polish UI, etc. See discord for full changes):
- Rescan old movie files to apply new custom formats!
- Delete poorly thought out life choi..., I mean custom formats.
- Rename R (regex) to RX and RE (required) to RQ, which of course makes way more sense
- Remove unwanted UI code
- Actually implemented idea that was supposed to be there from the beginning (I blame git) (Reject releases if custom format is not wanted by profile)
- Remember file names? Radarr intermittently forgot about them too! (Fixed Radarr not using filenames for parsing)
- Your custom format does not work??? Well now you at least know a bit more about that.
- When editing / creating a custom format, it will now be highlighted in the testing area, so you actually know if you are making it worse.
- You prefer large or small? Radarr doesn't judge! Create custom formats tailored to your preferences with the new size format tag! (G_)
- Want to manually edit your qualities since you are paranoid? Now Radarr has a unified quality editing UI for both manual import and files! (Also you can now manually set the custom formats for a file)
- Scared of change? Custom formats are completely hidden unless you enable advanced settings!  - Rescan old movie files to apply new custom formats! - Delete poorly thought out life choi..., I mean custom formats. - Rename R (regex) to RX and RE (required) to RQ, which of course makes way more sense - Remove unwanted UI code - Actually implemented idea that was supposed to be there from the beginning (I blame git) (Reject releases if custom format is not wanted by profile) - Remember file names? Radarr intermittently forgot about them too! (Fixed Radarr not using filenames for parsing) - Your custom format does not work??? Well now you at least know a bit more about that. - When editing / creating a custom format, it will now be highlighted in the testing area, so you actually know if you are making it worse. - You prefer large or small? Radarr doesn't judge! Create custom formats tailored to your preferences with the new size format tag! (G_) - Want to manually edit your qualities since you are paranoid? Now Radarr has a unified quality editing UI for both
2018-09-10 21:46:18 +02:00
Leonardo Galli
b4f456d5f0 [WIP] Additions to custom formats, such as rescanning old files. (#2949) 2018-09-10 21:25:10 +02:00
Leonardo Galli
1059e145c3 @cosmetic Updated changelog. 2018-08-26 22:41:47 +02:00
Leonardo Galli
5751c3f5f5 Merge remote-tracking branch 'origin/develop' into develop 2018-08-26 22:30:31 +02:00
Leonardo Galli
a458cdc0a5 Fixed: Annoying [renamemoviesfolder] Completed popup for no reason. 2018-08-26 22:27:26 +02:00
Leonardo Galli
ed631142c4 Fixed: Unnecessary housekeeping commands consuming a lot of memory.
Fixes #2962
2018-08-26 19:08:55 +02:00
Leonardo Galli
091bcc2333 Fixed: Concurrent manual imports silently failing
Fixes #2965
2018-08-23 23:05:20 +02:00
Leonardo Galli
e15225f4fc Fixed: Files that cannot be parsed, kill bulk import.
Fixes #2979
2018-08-23 22:58:48 +02:00
Leonardo Galli
79e570e571 Fixed: Absolutely Required Format Tag modifier being ignored when multiple modifiers were present
Fixes #2971
2018-08-21 21:56:49 +02:00
Mark McDowall
d99e520baa New: Upgrade MediaInfo to 17.10 (Windows/macOS) 2018-08-18 18:24:04 +02:00
Leonardo Galli
3d1cbd1613 Fixed: Error when valid movie file id is around, but movie file is not loaded. 2018-08-16 21:37:17 +02:00
Leonardo Galli
2cfc77abc3 @cosmetic updated readme 2018-08-12 19:49:59 +02:00
Leonardo Galli
b7012192b3 @cosmetic updated readme 2018-08-12 19:48:24 +02:00
Leonardo Galli
a24ea4feee @cosmetic Fixed changelog 2018-08-12 17:55:56 +02:00
Leonardo Galli
43d9aa8627 @cosmetic Updated changelog 2018-08-12 17:55:22 +02:00
Leonardo Galli
ad94a4a603 Fixed: Movies not being unmonitored when using clean library and lists.
Fixes #2584, Fixes #2906
2018-08-12 17:49:58 +02:00
Leonardo Galli
efb4127c35 Fixed: Also scan media info when file is being imported (i.e. not an existing file)
Fixes #2956
2018-08-12 17:29:29 +02:00
Leonardo Galli
253546ded0 Fixed: Invalid qualities messing up the release module and other stuff. 2018-08-09 18:08:47 +02:00
Leonardo Galli
587b49aaba Added: The ability to set the number of threads (NOT SUPPORTED!) to use for tasks using THREAD_LIMIT environment variable. 2018-08-07 23:20:58 +02:00
Leonardo Galli
b865103871 Fixed: Languages not showing up correctly. 2018-08-07 17:36:50 +02:00
Leonardo Galli
b7e35fada8 Fixed: Null exception due to resharper refactoring
Fixes #2947
2018-08-07 17:29:03 +02:00
Leonardo Galli
409be45a19 Fixed: No media info causing an error when importing files
Fixes #2945
2018-08-06 19:42:33 +02:00
Leonardo Galli
b553d8aef6 Fixed: Saving IndexerSettings into DB which confuses the datamapper.
Fixes #2945
2018-08-06 19:35:26 +02:00
Leonardo Galli
c4ca2f12bb Fixed: Not using correct info for determining state! 2018-08-05 18:12:49 +02:00
Leonardo Galli
77f146b262 Added: Ability to add custom formats, working similar to qualities. (#2669)
Originally called project metis, this feature allows you to do a lot of cool stuff, such as upgrading to a x265 encode, downloading releases with multiple languages, etc. Check out the wiki page at: https://github.com/Radarr/Radarr/wiki/Custom-Formats to learn more! Note: This feature is currently in "beta" and will get more tags and features in the future. Please let me know, if you have any issues and I hope this will allow for a lot of customization!
2018-08-05 16:28:05 +02:00
Leonardo Galli
d046a73f78 Create reaction.yml 2018-08-02 21:44:30 +02:00
Qstick
728a50c68f Fixed: .vtt files treated as subtitles (#2885) 2018-07-18 22:17:14 +02:00
Qstick
5470378af4 Fixed: Debug log Series reference in QualityAllowedByProfile spec (#2899) 2018-07-18 22:16:05 +02:00
Qstick
304b3ef560 Fixed: Multiple UI Fixes and Additions (#2894)
* Fixed: Misc UI Style Fixes and Cleanup

* Fixed: Change Icon names from Sonarr to Radarr

* Added: Search from Movies Index
2018-07-15 17:35:14 -04:00
hotio
5e35b43e48 Fixed: Multiline in table view on two lines (#2870)
Fixed: multiline in table view
2018-07-14 22:30:58 -04:00
Qstick
52ce836d5c Added: Adds unmonitored filter option in index and editor (#2888)
https://feathub.com/Radarr/Radarr/+40
2018-07-14 16:50:57 -04:00
Qstick
fe7bf8ec9e Added: Monitor Toggle on Movies Editor Page (#2887)
#610
2018-07-14 14:24:16 -04:00
Travis Boss
0db74fa583 Changed "importing an episode" to "importing a movie file" (#2829) 2018-07-08 23:26:47 +02:00
Leonardo Galli
806ba7e59d Fixed: AwesomeHD failing on an empty imdbid.
Fixes #2810
2018-05-27 22:38:09 +02:00
Leonardo Galli
111ed93853 @cosmetic Added release changelog config. 2018-05-27 12:44:53 +02:00
Leonardo Galli
9dd0a1d7ea @cosmetic Update Changelog 2018-05-27 12:21:10 +02:00
Leonardo Galli
b60ddf62e8 Added: AHD_Internal and G_Scene indexer flags. Also linked a wiki page with more information about indexer flags.
Fixes #203 Fixes #1519
2018-05-27 11:05:23 +02:00
bobbintb
d05fb8ee33 Added indexer flags to the list of environmental variable for customs scripts (on grab) (#2801)
Fixes #1282
2018-05-24 23:51:55 +02:00
Qstick
009abaf9be Fixed: Rare timing issue on first-use causing duplicate naming config (#2790)
Fixes #2773
2018-05-24 23:51:05 +02:00
Leonardo Galli
0d5c71d205 @cosmetic Changelog fixed images. 2018-05-21 11:41:18 +02:00
Leonardo Galli
cbdfc14755 @cosmetic Fixed Large changelog. 2018-05-21 11:39:33 +02:00
Leonardo Galli
396373068e @cosmetic Update Changelog 2018-05-21 11:32:35 +02:00
Qstick
c736df8116 Fixed: Qbittorrent state and eta fixes (#2789)
Fixes #2785
2018-05-21 10:43:06 +02:00
Qstick
f246fa87dd Fixed: Purge alt titles on movie delete (#2796)
Fixes #2542
2018-05-21 10:41:59 +02:00
Qstick
f058b8f364 Fixed: Don’t allow profiles in use by lists to be deleted (#2797) 2018-05-21 10:32:20 +02:00
Leonardo Galli
c1d2ea44b3 Update issue templates 2018-05-19 20:42:16 +02:00
Leonardo Galli
2dc848ca31 Fixed: Throwing error when indexer doesn't support a category. Now only warns the user. 2018-05-11 21:25:07 +02:00
Leonardo Galli
93ee849118 Fixed: Broken Newznab testing. 2018-05-11 19:29:19 +02:00
Leonardo Galli
8dcde96f3f @cosmetic Updated Changelog 2018-05-08 22:20:49 +02:00
Leonardo Galli
17bdc54586 Merge remote-tracking branch 'origin/develop' into develop 2018-05-08 22:19:41 +02:00
Leonardo Galli
d1c2569aa6 Fixed: Indexers that do not support movie search should give better error messages. Radarr now also complains if an indexer does not support certain categories. 2018-05-08 22:19:36 +02:00
Leonardo Galli
d6425a868b @cosmetic Updated issue template. 2018-05-08 22:23:13 +04:00
jusher00
9306249204 Fixed: Omgwtfnzbs API categories (UHD, Full BR and Other) (#2764)
Fixes #2724
2018-05-07 21:10:36 +02:00
Leonardo Galli
58044e0104 Fixed: RSS Feeds with no description failing to be added.
Fixes #1231
2018-05-07 18:57:35 +02:00
Leonardo Galli
40d6089a56 @cosmetic 2018-05-07 19:55:43 +04:00
Leonardo Galli
30796388b0 Fixed: Radarr not loading with an invalid sort key. 2018-04-17 22:06:14 +02:00
Leonardo Galli
b593c9272e @cosmetic Updated Changelog 2018-04-17 01:21:37 +02:00
Leonardo Galli
2782d19191 Added: More logging for strange PTP errors. Please report them immediately when you see them. 2018-04-17 01:21:14 +02:00
Qstick
c592fbf6c8 Fixed: Register as Radarr to avoid issues with Sonarr (#2715)
Fixes #1232
2018-04-16 23:24:10 +01:00
Qstick
210902ecb6 Added: Setting for Colon Replacement Format (#2711)
Fixes #2140
Fixes #2657
2018-04-16 23:22:54 +01:00
Qstick
38932d82db Added: Enable Download Client Priorities (#2699)
Fixes #229
2018-04-15 05:03:32 +02:00
Leonardo Galli
17c100a7e7 @cosmetic Added todo config. 2018-04-13 00:42:14 +01:00
Marcelo Castagna
ed4add85b8 Fixed: Handling of unknown status types in DownloadStation and Import from torrent Download Station should move since DS maintains an internal copy for seeding. (#2420)
Fixes #2000
2018-04-05 21:24:21 +02:00
Qstick
39346b6127 Fixed: Misc Extra File Improvements (This changes mapping of backdrop images to Fanart instead of Banner) (#2642)
Fixes #2556
Fixes #2639
Fixes #2547
2018-04-01 21:48:22 +02:00
Leonardo Galli
0f6c5533f1 @cosmetic Updated Changelog 2018-04-01 20:24:42 +02:00
Leonardo Galli
6eb678cd92 Added: Radarr now stores cookies for PTP beyond restarts. Should limit active sessions correctly. (#2643)
Fixes #2626
2018-04-01 20:21:24 +02:00
Qstick
a2fa8c4594 Fixed: Multiple Calendar Issues, Other UI Fixes (#2685)
Fixes #2683 Fixes #1172 Fixes #563
2018-03-28 18:54:50 +02:00
Leonardo Galli
00877ad361 Fixed: Cutoff Unmet Sorting by Downloaded Quality not working.
Fixes #2678
2018-03-26 18:59:24 +02:00
Qstick
802768bd24 Fixed: Add form param before submitting request (#2674)
Co-Authored-By: taloth <taloth@users.noreply.github.com>
2018-03-26 12:03:12 +02:00
Qstick
8ee71fd0fa New: Setting for absolute maximum size for a release (#2662)
* New: Setting for absolute maximum size for a release

* Change to Advanced Setting
2018-03-26 09:03:43 +02:00
Qstick
80b698a749 Fixed: Don't add category when removing torrent from qBittorrent (#2661)
Fixes #2655
2018-03-22 23:56:47 +01:00
mueslo
9db7bd09e1 Add underscore to host part of URI regex (#2633)
Fixes #2632
2018-03-22 23:56:23 +01:00
Leonardo Galli
c13ab1388e @cosmetic update readme 2018-03-19 23:37:24 +01:00
Leonardo Galli
0ff1908b06 @cosmetic Update Readme 2018-03-19 18:21:04 +01:00
Leonardo Galli
9b2ae8dd1f @cosmetic updated readme 2018-03-19 18:19:31 +01:00
Leonardo Galli
37c1db9c49 @cosmetic Updated changelog. 2018-03-19 12:35:51 +01:00
Leonardo Galli
b91906b530 Fixed: ICS malformed in a lot of cases. Also events are now all day.
Additionally, theatrical and physical release are shown. Fixes #2581
2018-03-19 12:11:19 +01:00
themagicbullet
2088f5e92d Fixed: Set category when adding torrent to qBittorrent (#2649)
Hopefully fixes: #2200
2018-03-19 11:44:35 +01:00
Qstick
25e10e26e3 Added: A Huge Cleanup of old Series Code. (Let's pray nothing breaks :P) (#2589) 2018-03-14 21:41:36 +01:00
AeonLucid
8a6d67a6d7 Update stale.yml 2018-03-13 00:54:33 +01:00
Leonardo Galli
b4823ea228 @cosmetic Updated readme 2018-03-12 19:37:32 +01:00
Leonardo Galli
6196679732 @cosmetic stale bot config 2018-03-11 15:36:19 +01:00
Leonardo Galli
862eb66843 Create support.yml 2018-03-11 15:30:02 +01:00
Leonardo Galli
2e94951506 Merge remote-tracking branch 'origin/develop' into develop 2018-03-07 21:38:06 +01:00
Leonardo Galli
d2b6b603a8 Fixed: Sort by Downloaded not working.
Fixes #2195
2018-03-07 21:37:57 +01:00
Leonardo Galli
fa40005222 @cosmetic 2018-03-07 19:30:13 +01:00
Qstick
eeb5e94f06 Fixed: Incorrect Kodi nfo date format (#2605)
Fixes #2582
2018-03-05 10:07:26 +01:00
Leonardo Galli
56acf751c5 @cosmetic Updated Changelog 2018-03-04 16:10:45 +01:00
Leonardo Galli
a48793edd2 Fixed: Changes in http redirect logic causing failed grabs and >25% cpu usage. 2018-03-04 16:01:40 +01:00
Leonardo Galli
799a448544 Fixed: http->https redirects do not use the tls1.2 curl fallback.
fixes #1862
2018-03-04 15:57:02 +01:00
Leonardo Galli
57adf0e3a5 Fixed: Dates before 1970 causing an exception.
Fixes #1913
2018-03-04 15:42:15 +01:00
Leonardo Galli
61ee8edb5a Fixed: Browser not updating on Movie File Imported.
Fixes #657
2018-03-04 15:35:12 +01:00
Leonardo Galli
ed1154ec3c @cosmetic Updated Changelog 2018-03-04 15:25:52 +01:00
Paul Kozlovitch
2d99f9268a Added: Copy & Paste now triggers search (#2587) 2018-03-04 15:24:49 +01:00
Simon Chapman
55dde613c2 Fixed: Movies not getting unmonitored when folder gets deleted (#2588)
Fixes #1191, fixes #1590
2018-03-04 15:24:07 +01:00
Leonardo Galli
b83f2ca0ee Merge remote-tracking branch 'origin/develop' into develop 2018-03-04 15:23:15 +01:00
Leonardo Galli
fc61f84522 @cosmetic Updated Changelog 2018-03-04 15:23:09 +01:00
Leonardo Galli
c1692ff84c Merge remote-tracking branch 'origin/develop' into develop 2018-03-03 17:08:31 +01:00
Leonardo Galli
65c3704ff0 Fixed: NLog causing a crash under mono 5.10
Fixes #2585
Merge remote-tracking branch 'origin/develop' into develop


Revert "Fixed: NLog causing a crash under mono 5.10"

This reverts commit d11b565eda.

Added console logging in case NLog fails to initialize.

Fixed: Updated NLog to 4.5 RC6 to handle mono 5.10
Fixed: Messed up merge from Cherry pick


Fixed: Appveyor build.


Revert "Fixed: Appveyor build."

This reverts commit 99282359c4.

Revert "Fixed: Messed up merge from Cherry pick"

This reverts commit 450d90586d.

Revert "Fixed: Updated NLog to 4.5 RC6 to handle mono 5.10"

This reverts commit 1b20cbb5e3.

Fixed: NLog causing issues with mono 5.10
2018-03-03 17:07:50 +01:00
Leonardo Galli
0ab7c19e54 Revert "Fixed: Updated NLog to 4.5 RC6 to handle mono 5.10"
This reverts commit 1b20cbb5e3.
2018-03-03 00:40:31 +01:00
Leonardo Galli
f70c769070 Revert "Fixed: Messed up merge from Cherry pick"
This reverts commit 450d90586d.
2018-03-03 00:40:23 +01:00
Leonardo Galli
702f61213c Revert "Fixed: Appveyor build."
This reverts commit 99282359c4.
2018-03-03 00:40:16 +01:00
Leonardo Galli
99282359c4 Fixed: Appveyor build. 2018-03-03 00:13:28 +01:00
Leonardo Galli
450d90586d Fixed: Messed up merge from Cherry pick 2018-03-02 20:04:16 +01:00
Leonardo Galli
1b20cbb5e3 Fixed: Updated NLog to 4.5 RC6 to handle mono 5.10 2018-03-02 20:00:28 +01:00
Taloth Saldono
400cf0e073 Added console logging in case NLog fails to initialize. 2018-03-02 19:56:48 +01:00
Leonardo Galli
79b3682b0f Revert "Fixed: NLog causing a crash under mono 5.10"
This reverts commit d11b565eda.
2018-03-02 19:55:47 +01:00
Leonardo Galli
cbf8106672 Merge remote-tracking branch 'origin/develop' into develop 2018-03-01 22:37:35 +01:00
Leonardo Galli
d11b565eda Fixed: NLog causing a crash under mono 5.10
Fixes #2585
2018-03-01 22:37:30 +01:00
Leonardo Galli
2ba1af5874 Merge pull request #2590 from Qstick/patch-1
Fixed: Pin Cake and Addin Versions
2018-03-01 08:55:59 +01:00
Qstick
731c9acd94 Fixed: Pin cake and addin versions 2018-02-28 23:08:18 -05:00
Qstick
59a176f03b Fixed: Temp Workaround for Appveyor Cake Issue 2018-02-27 22:43:16 -05:00
Qstick
6482024dc5 Fixed: Poster sliding issues (#2570)
Fixes #2568
2018-02-26 16:08:57 +01:00
Qstick
9e7e8cff11 Fixed: Multiple History Issues (#2571) 2018-02-26 16:08:44 +01:00
Leonardo Galli
15fe7a844c @cosmetic Updated Changelog 2018-02-21 11:04:23 +01:00
thezoggy
68d32e4d31 Fixed: Another Delete modal is fixed. (#2560)
Fixes #2537
2018-02-21 11:02:48 +01:00
thezoggy
29f540c4f2 Changed: Metadata links are now better readable. Also fixed links in the poster view. (#2562)
Fixes #2561
2018-02-21 11:02:04 +01:00
thezoggy
31eed11d1b Fixed: Messed up movie deletion modal (#2552)
Fixes #2537
2018-02-20 14:41:35 +01:00
thezoggy
ba0bbddce9 Fixed: Remove sorting on Monitor/Profile columns to prevent unexpected results until sorting can properly be handled. Quick Fix for #2540 (#2553)
Fixes #2540
2018-02-20 14:41:01 +01:00
thezoggy
a243a886f5 Fixed: OSX app has bundle name of Sonarr (#2555) 2018-02-20 14:40:35 +01:00
Leonardo Galli
033bc24984 @cosmetic update changelog 2018-02-19 16:16:04 +01:00
Leonardo Galli
e071850d4c Fixed: Alt Titles from TMDB not getting added when mappings server throws 404
Fixes #2535
2018-02-19 13:02:55 +01:00
Leonardo Galli
fa212872ab Added: Handle ctrl-c more gracefully.
Finally fixes #2218
2018-02-19 12:48:56 +01:00
Leonardo Galli
c34137c423 Merge remote-tracking branch 'origin/develop' into develop 2018-02-19 08:38:40 +01:00
Leonardo Galli
67848ebff5 Fixed: Omgwtfnbs parsing being too greedy.
Fixes #608
2018-02-19 08:37:47 +01:00
Qstick
d0406ced40 Fixed: Unable to execute custom scripts if IMDB ID is null (#2543)
fixes #1460
2018-02-19 08:19:14 +01:00
Qstick
ae88645180 Added: Device names for Join notifications (#2544)
Closes #2364
2018-02-19 08:18:36 +01:00
Qstick
8519b64947 Cleanup TV related code in API (#2530) 2018-02-19 08:18:14 +01:00
Leonardo Galli
d67d89f54a Merge remote-tracking branch 'origin/develop' into develop 2018-02-19 00:01:11 +01:00
Leonardo Galli
2b2bd16d4d Updated NLog to version 4.4.12. Should fix #2218 2018-02-19 00:00:59 +01:00
Qstick
0c23511b7a Added: Same File Size MediaFile Specification (#2532) 2018-02-18 17:29:41 +01:00
Qstick
4dc3612347 Fixed: Help icon not centered (#2531)
Fixes #2528
2018-02-18 15:06:53 +01:00
Qstick
2139246c4a Fixed: Radarr Changes every file due to timezones (#2533)
Fixes #1741
2018-02-18 15:06:26 +01:00
Leonardo Galli
c1a5e8e759 Fixed: Filters not working. Fuck you backbone. 2018-02-16 17:12:34 +01:00
Qstick
e70e76adcb Cleanup Series Code from UI (#2525) 2018-02-16 10:53:41 +01:00
Leonardo Galli
1dbb856ced Fixed: Apostrophe getting replaced by an empty string causing no search results.
Fixes #1505
2018-02-15 15:21:15 +01:00
Leonardo Galli
74396a7abb @cosmetic Updated changelog 2018-02-15 15:03:33 +01:00
Qstick
e7e9e2b154 Added: Importing extra files from downloaded movies and generate metadata such as .nfo (#2506)
Fixes #121, Fixes #167, Fixes #2262 and Fixes #1104
2018-02-15 13:39:01 +01:00
Qstick
b40423f3a3 Added: Quotes around alternative titles (#2522)
Fixes #2511
2018-02-15 11:16:59 +01:00
Qstick
b3e46d02c6 Fixed: Integration Unit Tests (#2500) 2018-02-13 19:10:49 +01:00
Qstick
081d8a8e53 Added: Backup improvements from Sonarr (#2513)
Fixes #2440
2018-02-13 19:07:26 +01:00
Leonardo Galli
2f271635f9 @cosmetic fixed build 2018-02-12 17:37:11 +01:00
Leonardo Galli
c460153e66 @cosmetic fixed indentation error. 2018-02-12 17:33:14 +01:00
Leonardo Galli
8a674181be @cosmetic Staged builds & upload artifacts. 2018-02-12 17:31:18 +01:00
Leonardo Galli
7537cef93c @cosmetic Fixed junit transformer. 2018-02-12 17:18:25 +01:00
Leonardo Galli
808b6d16e9 @cosmetic added junit transformer 2018-02-12 17:15:14 +01:00
Leonardo Galli
d1189e62c5 @cosmetic custom docker image for circleci 2018-02-12 17:10:44 +01:00
Leonardo Galli
ef86c83799 @cosmetic changed config again. 2018-02-12 16:37:33 +01:00
Leonardo Galli
aeb45e5f7e @cosmetic update test.sh 2018-02-12 16:27:48 +01:00
Leonardo Galli
149c7c534c @cosmetic update config. 2018-02-12 16:21:21 +01:00
Leonardo Galli
74ae66ba14 @cosmetic Wrong filename. 2018-02-12 16:10:53 +01:00
Leonardo Galli
f94e7b562a @cosmetic Testing CircleCI for tests. 2018-02-12 16:06:31 +01:00
Leonardo Galli
f5a7a2f29a @cosmetic 2018-02-11 22:59:11 +01:00
Qstick
1514a00b8f Updated: NzbDrone references in FirewallAdapter.cs (#2504) 2018-02-11 17:22:31 +01:00
Scott
3ed0652feb Fixed: XSS vulnerability in the navbar search. (#2505)
Fixes #2503
2018-02-11 17:20:55 +01:00
Qstick
f4e2a510f2 Fixed: StartNzbDroneService.cs unit test (#2499) 2018-02-10 00:04:22 +01:00
geogolem
8edd15b5f8 Merge pull request #2497 from geogolem/selectAllMovieEditor
selectAll and deselectAll MovieEditor buttons
2018-02-09 11:59:31 -05:00
geogolem
2fdfd0fba5 selectAll and deselectAll MovieEditor buttons 2018-02-09 11:41:31 -05:00
geogolem
8b201af053 Merge pull request #2493 from geogolem/develop
fix build problem on windows
2018-02-08 09:35:41 -05:00
geogolem
976bc1a6a5 fix build problem on windows 2018-02-08 09:22:58 -05:00
Leonardo Galli
16ba7194a9 Merge branch 'develop' of https://github.com/Radarr/Radarr into develop 2018-02-08 11:26:58 +01:00
Leonardo Galli
a151fbbcbe Revert "Fixed: Removed hebrew ISO, since english movies are still in english. (#1922)" 2018-02-08 11:26:43 +01:00
Leonardo Galli
71db67af2c @cosmetic 2018-02-07 17:27:04 +01:00
Leonardo Galli
1d2231a96d @cosmetic 2018-02-07 17:26:43 +01:00
Leonardo Galli
0837d3a8a0 @cosmetic 2018-02-07 17:26:23 +01:00
Leonardo Galli
05e5d610a3 @cosmetic 2018-02-07 17:11:51 +01:00
Leonardo Galli
d2f99f1330 Fixed: Error with deluge when it doesn’t report a Hash.
Fixes #2329
2018-02-07 15:59:14 +01:00
Leonardo Galli
27001b48f6 Fixed: Logging error when accessing mount point
Fixes #2305
2018-02-07 15:26:25 +01:00
Leonardo Galli
97ab4cbcbd Fixed: Invalid runtime from CP causing issues importing.
Fixes #2081
2018-02-07 12:04:27 +01:00
Leonardo Galli
8b3a71a537 Fixed: Typo in TMDB Settings.
Fixes #2077
2018-02-07 11:57:49 +01:00
Leonardo Galli
e22141e2ed Fixed: Hopefully fixed errors with Delay Profiles.
Fixes #1817
2018-02-07 11:24:58 +01:00
Leonardo Galli
11211dc2ed Fixed: Error when importing files and old folder doesn’t exist.
Fixes #2485
2018-02-07 11:08:05 +01:00
Leonardo Galli
e71e518d30 Fixed: Zooqle torrents not getting added, since their torrent file is messed up.
Fixes #1516
2018-02-07 00:10:33 +01:00
Leonardo Galli
f9049566c1 Fixed: No Physical Release Date causing exception when setting last write time.
Fixes #390
2018-02-06 16:51:19 +01:00
Leonardo Galli
0bc61bea38 Fixed: Movies not getting unmonitored when folder gets deleted.
Fixes #1191, Fixes #1590
2018-02-03 16:44:35 +01:00
Leonardo Galli
032fc68892 Added: Include total space with root folders
Closes #2468
2018-02-02 23:13:26 +01:00
Leonardo Galli
33cc228ac1 Fixed: Rare case of null quality causing issues with manual import.
Fixes #2227
2018-02-02 15:01:02 +01:00
Leonardo Galli
d5832a6a07 Added: Manual Import now adds year after movie title for filtering. This should help finding movies such as IT.
By searching e.g. It 2017, movies with short titles should be easily filterable now. Also displays more results (50 instead of 20)
2018-02-02 14:53:03 +01:00
Leonardo Galli
5f8aeeac17 Fixed: Manual Import not automatically choosing right movie.
Fixes #2458, Fixes #2061
Generally improved Manual Import UI
2018-02-02 14:51:18 +01:00
Leonardo Galli
54e57bf16a Merge remote-tracking branch 'origin/develop' into develop 2018-02-02 13:23:36 +01:00
Leonardo Galli
b1f76082b2 Added: Dynamic paths cleanup old folders now!
Old folder is now only left behind if extra files are also present in new dir and cannot be overwritten. Generally Dynamic Paths should be more stable now. Fixes #2048
2018-02-02 13:23:29 +01:00
Leonardo Galli
73fed04228 Fixed: Rare case of RequiredIndexerFlags failing with old Newznab indexers. 2018-02-01 16:00:55 +01:00
Leonardo Galli
ca3d5c184e Merge branch 'develop' of https://github.com/Radarr/Radarr into develop 2018-02-01 14:20:01 +01:00
Leonardo Galli
861962d06c Added: Option to require indexer flags per indexer. (e.g. only download freeleech torrents from a private tracker) (#2460) 2018-02-01 14:18:52 +01:00
Leonardo Galli
5057fcc40f Fixed: Folder name getting messed up when adding movies via a list.
Fixes #2465
2018-02-01 14:14:45 +01:00
Leonardo Galli
78e5fdf3bc Added: Files downloaded with different quality than grabbed will get rejected.
Fixes #1779, Fixes #2087, Fixes #1321
2018-01-31 20:09:04 +01:00
Leonardo Galli
aab14d02f9 Fixed: Error when adding an already excluded movie to the exclusion list.
Fixes #2462
2018-01-31 15:03:29 +01:00
Leonardo Galli
eb1c3c8b82 Fixed: Last commit still not compiling (whoops squared) 2018-01-30 18:33:30 +01:00
Leonardo Galli
4025af7895 Fixed: Last commit not compiling (whoops) 2018-01-30 18:31:07 +01:00
Leonardo Galli
95ca863697 Fixed: Clean Library being to agressive when lists are having failures.
Fixes #2455
2018-01-30 18:29:07 +01:00
Leonardo Galli
74e0db2829 @cosmetic Fixed all erroring tests. 2018-01-30 15:09:19 +01:00
Leonardo Galli
2459ddb6f4 Fixed: Error when nno quality was associated with a movie file.
Fixes #1991
2018-01-30 13:16:06 +01:00
Leonardo Galli
3e2e085b6b Fixed: Allowing in use Profiles to be Deleted.
Fixes #2030
2018-01-30 13:11:16 +01:00
Leonardo Galli
931cdacf66 Fixed: Error when Movie has no imdbid when searching Rargb
Fixes #2090
2018-01-30 12:59:45 +01:00
Leonardo Galli
18c622de40 Fixed: Rargb failing when imdbid is not found
Fixes #1845, Fixes #2319
2018-01-30 12:56:14 +01:00
Leonardo Galli
53e6fa7cf1 Fixed: {Original Filename} not allowed in Movie Filename
Fixes #1248
2018-01-30 12:42:06 +01:00
Qstick
4afd3f3bfe Fixed: Look for changes to package.json before using old build cache (#2445) 2018-01-26 08:54:59 +01:00
crhammock
da425b04b1 Updated: TMDbSettings.cs to allow pipe for or for genre ids (#2389) 2018-01-11 17:06:26 +01:00
Pieter Janssens
663ac972cd Fixed: HistoryDetailsLayoutTemplate.hbs (#2361) 2017-12-21 13:42:02 +01:00
Taloth Saldono
efbb587290 Fixed MediaCover endpoint. 2017-12-13 21:28:42 +01:00
Mark McDowall
72a12a73af Fixed: Don't handle content requests in IndexHtmlMapper 2017-12-13 21:28:21 +01:00
fhscholl
95bc93042c Added: Separate naming tags for AudioLanguage and SubtitleLanguage (#2261) (Fixes #2257) 2017-12-12 23:53:11 +01:00
Leonardo Galli
172cf4d06e Fixed: Movies parsed from lists with no year and only title getting added mutliple times. 2017-12-12 23:26:16 +01:00
Taloth Saldono
5ac0f28fff Fixed: Security Vulnerabilities allowing authentication to be bypassed (discovered by Kyle Neideck) 2017-12-12 23:15:46 +01:00
Leonardo Galli
948af901da Added: Include APFS disks in disk space calculation. 2017-12-12 22:46:00 +01:00
Leonardo Galli
f36716135b Added: Upgrade MediaInfo to 17.10 (Windows/macOS) 2017-12-12 22:44:14 +01:00
kriegalex
b70016d082 Added: Support for VF2 french tag. (#2291) (Fixes #2290) 2017-12-12 22:28:36 +01:00
grokdesigns
6a1b099117 Added: Customize Slack Channel (#2308) (Fixes #2298) 2017-12-04 09:07:42 +01:00
Leonardo Galli
ffb098357d Fixed: Movie Editor Path screwed up. Might also fix some other movie editor issues. (Fixes #2170) 2017-11-19 15:11:53 +01:00
Leonardo Galli
1a22486aba Fixed: Tags disappearing (Fixes #2204) 2017-11-19 14:57:15 +01:00
Fish2
72631eab8f Fixed: moment.js deprecated zone and add functions (Fixes #2232) (Fixes #2231) (#2264) 2017-11-16 20:20:41 +01:00
Mike
e4a3e63c44 Fixed: CPU locking at a 100% in certain instances. (#2258) (Fixes #2218) 2017-11-12 12:25:46 +01:00
Fish2
5dc2df3d49 Revert "Fixed: moment.js deprecated zone and Added: and lossless compression of images (#2232) (Fixes #2231)"
This reverts commit 32b1f75eb3.
2017-11-10 17:11:42 +01:00
fhscholl
01f0c6d85f Added: SceneName to MovieFile API output (#2250) (Fixes #2245) 2017-11-10 16:13:14 +01:00
fhscholl
c7c423b13d Added: Functionality to XBMC and Plex to update indivdual titles. Also: Notification Cleanup (#2240) 2017-11-10 16:11:09 +01:00
Fish2
32b1f75eb3 Fixed: moment.js deprecated zone and Added: and lossless compression of images (#2232) (Fixes #2231) 2017-11-10 16:08:02 +01:00
adnanklink
29909db604 Added: FolderPath to the Movie Webhook (#2230) 2017-11-10 16:06:45 +01:00
Mike
ec3f094d12 Fixes #2218. (#2254)
* Fixed: Raise ApplicationStartupEvent after Owin is running.

* Actually inject the container.
2017-11-08 19:39:50 +01:00
adnanklink
cb857934c4 Added: Download_Id to On Download/On Upgrade (#2229) 2017-10-29 19:19:30 +01:00
Leonardo Galli
d0174c7b7b Merge remote-tracking branch 'origin/develop' into develop 2017-10-29 12:24:41 +01:00
Leonardo Galli
9d19c4ec21 Fixed: Manual Import. Fixes #2160 2017-10-29 12:24:35 +01:00
fhscholl
0a030386f2 Added: Movie_Quality to onGrab (#2221) (Fixes #1833) 2017-10-28 17:19:49 +02:00
fhscholl
5e121c78e1 Updated: Webhook Improvements (#2220) (Fixes #1751) 2017-10-28 17:18:52 +02:00
James White
b521ffb588 Added: Message about adblockers preventing the log table from loading (#2213) (Fixes #2209) 2017-10-23 21:50:03 +02:00
James White
386a434aeb Changed: Sabnzbd Update test cases and rename to MovieCategory (#2212) 2017-10-23 21:49:02 +02:00
James White
5674d8ad60 Changed: Nzbget Rename TvCategory references to MovieCategory (#2211) 2017-10-23 21:47:49 +02:00
Oliver Rivett-Carnac
b313dd1845 Minor error message tweak (#1778)
* Added: some tips to how to build. Gave some info to Windows developers.

* Fixed: Alignment of validation errors in labels

* Fixed: error message mentioning 'series'
2017-10-22 20:58:25 -04:00
James White
dffa50a82f uTorrent initial state feature (#2192)
* New: Initial state for torrents added to UTorrent

Closes #409

(cherry picked from commit 19a4d3536b)

* Change default port

* Rename TvCategory to MovieCategory
2017-10-22 20:51:07 -04:00
James White
5337f79281 Change default port of qBittorrent download client config (#2187) 2017-10-22 20:49:54 -04:00
fhscholl
8861c8d8a4 Add IsUpgrade and related deleted file paths for CustomScript (#2205)
* Add IsUpgrade flag and deleted file paths for updates

* use OldMovieFiles instead of OldFiles
2017-10-22 20:49:37 -04:00
James White
4574ff5f6d Fixed: typo on margin-bottom (#2182) 2017-10-15 16:11:27 +02:00
James White
dd53e51468 @cosmetic Fix jshint warnings on MoviesCollection.js (#2180) 2017-10-15 13:37:19 +02:00
James White
7ae2d455c3 Fixed: Remove unit on zero values (#2178) 2017-10-15 13:29:32 +02:00
James White
e2e6630b69 Added: Initial state for torrents added to qBittorrent (#2176) 2017-10-15 12:35:53 +02:00
James White
ed744b5702 Fixed: Jackett apikey cleaned from log again. (#2177) 2017-10-15 12:35:04 +02:00
Leonardo Galli
5ffa27ec29 @cosmetic changed title 2017-10-14 12:05:17 +02:00
Leonardo Galli
53bfe61eb6 @cosmetic Added status images for websites and update api. 2017-10-14 12:04:22 +02:00
Leonardo Galli
a4a8e4547f Merge remote-tracking branch 'origin/develop' into develop 2017-10-11 23:09:36 +02:00
Leonardo Galli
e2bda29737 Fixed: Manual Movie Page Filtering. 2017-10-11 23:09:29 +02:00
James White
ab117082ed @cosmetic Stop commented out code appearing in HTML source (#2158) 2017-10-11 22:55:33 +02:00
Leonardo Galli
c708c3f5a1 Merge remote-tracking branch 'origin/develop' into develop 2017-10-11 22:54:51 +02:00
Leonardo Galli
a98494ab63 Fixed: MediaInfo not getting read when quality isn't Bluray, Web-dl or HDTV. Fixes #1465. Fixes #1572. 2017-10-11 22:54:45 +02:00
James White
779a722175 Changed: Adjust ambiguous date options (#2165)
(cherry picked from commit 00c3074216)
2017-10-11 22:45:15 +02:00
James White
805927205c @cosmetic Simplify ical ProductId code since adding properties (#2164) 2017-10-11 21:11:16 +02:00
James White
1d8eec42ef Added: a default name for Radarr.ics (#2163) 2017-10-11 19:19:57 +02:00
Leonardo Galli
a951ad811d @cosmetic Updated changelog. 2017-10-09 21:51:21 +02:00
1628 changed files with 34423 additions and 48027 deletions

16
.gitattributes vendored
View File

@@ -1,13 +1,17 @@
# Auto detect text files and perform LF normalization
*text eol=lf
* text=auto
# Explicitly set bash scripts to have unix endings
*.sh text eol=lf
macOS/Radarr text eol=lf
# Custom for Visual Studio
*.cs diff=csharp
*.sln merge=union
*.csproj merge=union
*.vbproj merge=union
*.fsproj merge=union
*.dbproj merge=union
#*.sln merge=union
#*.csproj merge=union
#*.vbproj merge=union
#*.fsproj merge=union
#*.dbproj merge=union
# Standard to msysgit
*.doc diff=astextplain

View File

@@ -1,293 +0,0 @@
# -*- coding: utf-8; mode: python -*-
##
## Format
##
## ACTION: [AUDIENCE:] COMMIT_MSG [!TAG ...]
##
## Description
##
## ACTION is one of 'chg', 'fix', 'new'
##
## Is WHAT the change is about.
##
## 'chg' is for refactor, small improvement, cosmetic changes...
## 'fix' is for bug fixes
## 'new' is for new features, big improvement
##
## AUDIENCE is optional and one of 'dev', 'usr', 'pkg', 'test', 'doc'
##
## Is WHO is concerned by the change.
##
## 'dev' is for developpers (API changes, refactors...)
## 'usr' is for final users (UI changes)
## 'pkg' is for packagers (packaging changes)
## 'test' is for testers (test only related changes)
## 'doc' is for doc guys (doc only changes)
##
## COMMIT_MSG is ... well ... the commit message itself.
##
## TAGs are additionnal adjective as 'refactor' 'minor' 'cosmetic'
##
## They are preceded with a '!' or a '@' (prefer the former, as the
## latter is wrongly interpreted in github.) Commonly used tags are:
##
## 'refactor' is obviously for refactoring code only
## 'minor' is for a very meaningless change (a typo, adding a comment)
## 'cosmetic' is for cosmetic driven change (re-indentation, 80-col...)
## 'wip' is for partial functionality but complete subfunctionality.
##
## Example:
##
## new: usr: support of bazaar implemented
## chg: re-indentend some lines !cosmetic
## new: dev: updated code to be compatible with last version of killer lib.
## fix: pkg: updated year of licence coverage.
## new: test: added a bunch of test around user usability of feature X.
## fix: typo in spelling my name in comment. !minor
##
## Please note that multi-line commit message are supported, and only the
## first line will be considered as the "summary" of the commit message. So
## tags, and other rules only applies to the summary. The body of the commit
## message will be displayed in the changelog without reformatting.
##
## ``ignore_regexps`` is a line of regexps
##
## Any commit having its full commit message matching any regexp listed here
## will be ignored and won't be reported in the changelog.
##
ignore_regexps = [
r'@minor', r'!minor',
r'@cosmetic', r'!cosmetic',
r'@refactor', r'!refactor',
r'@wip', r'!wip',
r'^([cC]hg|[fF]ix|[nN]ew)\s*:\s*[p|P]kg:',
r'^([cC]hg|[fF]ix|[nN]ew)\s*:\s*[d|D]ev:',
r'^(.{3,3}\s*:)?\s*[fF]irst commit.?\s*$',
r'^$', ## ignore commits with empty messages
]
## ``section_regexps`` is a list of 2-tuples associating a string label and a
## list of regexp
##
## Commit messages will be classified in sections thanks to this. Section
## titles are the label, and a commit is classified under this section if any
## of the regexps associated is matching.
##
## Please note that ``section_regexps`` will only classify commits and won't
## make any changes to the contents. So you'll probably want to go check
## ``subject_process`` (or ``body_process``) to do some changes to the subject,
## whenever you are tweaking this variable.
##
section_regexps = [
('**New Features**', [
r'^[aA]dded?\s*:?\s*((dev|use?r|pkg|test|doc)\s*:\s*)?([^\n]*)$',
r'^[uU]pdated?\s*:?\s*((dev|use?r|pkg|test|doc)\s*:\s*)?([^\n]*)$',
r'^[cC]hanged?\s*:?\s*((dev|use?r|pkg|test|doc)\s*:\s*)?([^\n]*)$',
]),
('**Fixes**', [
r'^(?![mM]erge\s*)'
]
),
]
## ``body_process`` is a callable
##
## This callable will be given the original body and result will
## be used in the changelog.
##
## Available constructs are:
##
## - any python callable that take one txt argument and return txt argument.
##
## - ReSub(pattern, replacement): will apply regexp substitution.
##
## - Indent(chars=" "): will indent the text with the prefix
## Please remember that template engines gets also to modify the text and
## will usually indent themselves the text if needed.
##
## - Wrap(regexp=r"\n\n"): re-wrap text in separate paragraph to fill 80-Columns
##
## - noop: do nothing
##
## - ucfirst: ensure the first letter is uppercase.
## (usually used in the ``subject_process`` pipeline)
##
## - final_dot: ensure text finishes with a dot
## (usually used in the ``subject_process`` pipeline)
##
## - strip: remove any spaces before or after the content of the string
##
## - SetIfEmpty(msg="No commit message."): will set the text to
## whatever given ``msg`` if the current text is empty.
##
## Additionally, you can `pipe` the provided filters, for instance:
#body_process = Wrap(regexp=r'\n(?=\w+\s*:)') | Indent(chars=" ")
#body_process = Wrap(regexp=r'\n(?=\w+\s*:)')
#body_process = noop
body_process = ReSub(r'((^|\n)[A-Z]\w+(-\w+)*: .*(\n\s+.*)*)+$', r'') | strip
## ``subject_process`` is a callable
##
## This callable will be given the original subject and result will
## be used in the changelog.
##
## Available constructs are those listed in ``body_process`` doc.
subject_process = (strip |
ReSub(r'^([cC]hanged|[fF]ixed|[aA]dded|[uU]pdated)\s*:\s*((dev|use?r|pkg|test|doc)\s*:\s*)?([^\n@]*)(@[a-z]+\s+)*$', r'\4') |
SetIfEmpty("No commit message.") | ucfirst | final_dot)
## ``tag_filter_regexp`` is a regexp
##
## Tags that will be used for the changelog must match this regexp.
##
tag_filter_regexp = r'^v[0]+\.[2-9]+\.[0-9]+\.[0-9]+$'
## ``unreleased_version_label`` is a string or a callable that outputs a string
##
## This label will be used as the changelog Title of the last set of changes
## between last valid tag and HEAD if any.
unreleased_version_label = "(unreleased)"
## ``output_engine`` is a callable
##
## This will change the output format of the generated changelog file
##
## Available choices are:
##
## - rest_py
##
## Legacy pure python engine, outputs ReSTructured text.
## This is the default.
##
## - mustache(<template_name>)
##
## Template name could be any of the available templates in
## ``templates/mustache/*.tpl``.
## Requires python package ``pystache``.
## Examples:
## - mustache("markdown")
## - mustache("restructuredtext")
##
## - makotemplate(<template_name>)
##
## Template name could be any of the available templates in
## ``templates/mako/*.tpl``.
## Requires python package ``mako``.
## Examples:
## - makotemplate("restructuredtext")
##
#output_engine = rest_py
#output_engine = mustache("restructuredtext")
output_engine = mustache("changelog.tpl")
#output_engine = makotemplate("restructuredtext")
## ``include_merge`` is a boolean
##
## This option tells git-log whether to include merge commits in the log.
## The default is to include them.
include_merge = False
## ``log_encoding`` is a string identifier
##
## This option tells gitchangelog what encoding is outputed by ``git log``.
## The default is to be clever about it: it checks ``git config`` for
## ``i18n.logOutputEncoding``, and if not found will default to git's own
## default: ``utf-8``.
#log_encoding = 'utf-8'
## ``publish`` is a callable
##
## Sets what ``gitchangelog`` should do with the output generated by
## the output engine. ``publish`` is a callable taking one argument
## that is an interator on lines from the output engine.
##
## Some helper callable are provided:
##
## Available choices are:
##
## - stdout
##
## Outputs directly to standard output
## (This is the default)
##
## - FileInsertAtFirstRegexMatch(file, pattern, idx=lamda m: m.start())
##
## Creates a callable that will parse given file for the given
## regex pattern and will insert the output in the file.
## ``idx`` is a callable that receive the matching object and
## must return a integer index point where to insert the
## the output in the file. Default is to return the position of
## the start of the matched string.
##
## - FileRegexSubst(file, pattern, replace, flags)
##
## Apply a replace inplace in the given file. Your regex pattern must
## take care of everything and might be more complex. Check the README
## for a complete copy-pastable example.
##
# publish = FileInsertIntoFirstRegexMatch(
# "CHANGELOG.rst",
# r'/(?P<rev>[0-9]+\.[0-9]+(\.[0-9]+)?)\s+\([0-9]+-[0-9]{2}-[0-9]{2}\)\n--+\n/',
# idx=lambda m: m.start(1)
# )
#publish = stdout
def write_to_file(content):
with open("CHANGELOG.md", "w+") as f:
for chunk in content:
f.write(chunk)
publish = write_to_file
## ``revs`` is a list of callable or a list of string
##
## callable will be called to resolve as strings and allow dynamical
## computation of these. The result will be used as revisions for
## gitchangelog (as if directly stated on the command line). This allows
## to filter exaclty which commits will be read by gitchangelog.
##
## To get a full documentation on the format of these strings, please
## refer to the ``git rev-list`` arguments. There are many examples.
##
## Using callables is especially useful, for instance, if you
## are using gitchangelog to generate incrementally your changelog.
##
## Some helpers are provided, you can use them::
##
## - FileFirstRegexMatch(file, pattern): will return a callable that will
## return the first string match for the given pattern in the given file.
## If you use named sub-patterns in your regex pattern, it'll output only
## the string matching the regex pattern named "rev".
##
## - Caret(rev): will return the rev prefixed by a "^", which is a
## way to remove the given revision and all its ancestor.
##
## Please note that if you provide a rev-list on the command line, it'll
## replace this value (which will then be ignored).
##
## If empty, then ``gitchangelog`` will act as it had to generate a full
## changelog.
##
## The default is to use all commits to make the changelog.
#revs = ["^1.0.3", ]
#revs = [
# Caret(
# FileFirstRegexMatch(
# "CHANGELOG.rst",
# r"(?P<rev>[0-9]+\.[0-9]+(\.[0-9]+)?)\s+\([0-9]+-[0-9]{2}-[0-9]{2}\)\n--+\n")),
# "HEAD"
#]
revs = []

8
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1,8 @@
# These are supported funding model platforms
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: radarr
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
custom: # Replace with a single custom sponsorship URL

View File

@@ -1,16 +1,22 @@
**Description:**
Check first that your problem is not listed in our wiki section:
<!-- Check first that your problem is not listed in our wiki section:
* https://github.com/Radarr/Radarr/wiki/Common-Problems
* https://github.com/Radarr/Radarr/wiki/FAQ
**Just because you receive an exception in your logs, doesn't mean it's a bug and should be reported here. Often it's something else, such as a permission error. If you are unsure ask on the Discord or Subreddit first.**
Visit our [Discord server](https://discord.gg/NWYch8M) or [Subreddit](https://reddit.com/r/radarr) for support or longer discussions. Support questions posed on here will be closed immediately.
Provide a description of the feature request or bug here, the more details the better.
Please also try to include the following if you are reporting a bug
Please also include the following if you are reporting a bug. If you do not include it, the issue will probably be closed as we cannot help you. -->
**Radarr Version:**
**Logs:**
**Mono Version:**
**Debug Logs:**
Please use the search bar and make sure you are not submitting an already submitted issue.
Visit our [Discord server](https://discord.gg/NWYch8M) for support or longer discussions.
# Do not remove anything from your logs and post the full logs! If not everything fits in here use a service like https://pastebin.com to upload them.
<!-- Please use the search bar (make sure to include closed issues as well) and make sure you are not submitting an already submitted issue. -->

31
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@@ -0,0 +1,31 @@
---
name: Bug report
about: Support requests will be closed immediately, if you are unsure go to our Discord
or Subreddit first. Exceptions do not mean you found a bug!
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
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.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- OS: [e.g. Windows]
- Mono Version: [e.g. Mono 5.8] (Only needed under Linux and Mac, found under System -> Status)
- Browser and Version [e.g. chrome, safari] (Only needed for UI issues)
- Version [e.g. 22]
**Debug Logs**
Turn on debug logs under Settings -> General and wait for the bug to occur again. **Upload the full log file here (or another site and link it). Issues will be closed, if they do not include this!**

View File

@@ -0,0 +1,17 @@
---
name: Feature request
about: Suggest an idea for this project
---
**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 [...]
**Describe the solution you'd like**
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.
**Additional context**
Add any other context or screenshots about the feature request here.

2
.github/config.yml vendored Normal file
View File

@@ -0,0 +1,2 @@
todo:
keyword: "TODO"

1
.github/reaction.yml vendored Normal file
View File

@@ -0,0 +1 @@

16
.github/stale.yml vendored Normal file
View File

@@ -0,0 +1,16 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 60
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- feature request
- parser
- confirmed
# Label to use when marking an issue as stale
staleLabel: stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had recent activity. Please verify that this is still an issue with the latest version of Radarr and report back. Otherwise this issue will be closed.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false

13
.github/support.yml vendored Normal file
View File

@@ -0,0 +1,13 @@
# Configuration for support-requests - https://github.com/dessant/support-requests
# Label used to mark issues as support requests
supportLabel: support
# Comment to post on issues marked as support requests. Add a link
# to a support page, or set to `false` to disable
supportComment: >
We use the issue tracker exclusively for bug reports and feature requests.
However, this issue appears to be a support request. Please hop over onto our [Discord](https://discord.gg/ZDmT7qb) or [Subreddit](https://reddit.com/r/radarr)
# Whether to close issues marked as support requests
close: true
# Whether to lock issues marked as support requests
lock: false

64
.gitignore vendored
View File

@@ -11,6 +11,7 @@ src/**/[Oo]bj/
*.user
*.sln.docstates
.vs/
.vscode/
# Build results
*_i.c
@@ -45,6 +46,10 @@ _dotCover*
# DevExpress CodeRush
src/.cr/
# Emacs
*~
\#*\#
# NCrunch
*.ncrunch*
.*crunch*.local.xml
@@ -80,7 +85,6 @@ TestResults
[Tt]est[Rr]esult*
*.Cache
ClientBin
[Ss]tyle[Cc]op.*
~$*
*.dbmdl
Generated_Code #added for RIA/Silverlight projects
@@ -102,40 +106,44 @@ _NCrunch_*
_TeamCity*
# Radarr
Backups/
logs/
MediaCover/
UpdateLogs/
xdg/
config.xml
logs.db*
nzbdrone.db*
nzbdrone.pid
nzbdrone.log*txt
UpdateLogs/
*workspace.xml
*.test-cache
*.userprefs
*/test-results/*
src/UI/.idea/*
*log.txt
node_modules/
_output*
_artifacts
_rawPackage/
_dotTrace*
_tests/
*.Result.xml
coverage*.xml
coverage*.json
setup/Output/
*.~is
UI.Phantom/
# VS outout folders
bin
obj
output/*
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
**/Properties/launchSettings.json
# Packages
Radarr_*/
Radarr_*.zip
Radarr_*.gz
gecko.zip
geckodriver.exe
# macOS metadata files
._*
@@ -148,5 +156,37 @@ _temp_*/**/*
Thumbs.db
# AppVeyor
/tools-cake/
/tools/cake/
/_artifacts/
# Cake
/tools/Addins/*
packages.config.md5sum
# Common IntelliJ Platform excludes
# User specific
**/.idea/**/workspace.xml
**/.idea/**/tasks.xml
**/.idea/shelf/*
**/.idea/dictionaries
**/.idea/.idea.Radarr.Posix
**/.idea/.idea.Radarr.Windows
# Sensitive or high-churn files
**/.idea/**/dataSources/
**/.idea/**/dataSources.ids
**/.idea/**/dataSources.xml
**/.idea/**/dataSources.local.xml
**/.idea/**/sqlDataSources.xml
**/.idea/**/dynamic.xml
# Rider
# Rider auto-generates .iml files, and contentModel.xml
**/.idea/**/*.iml
**/.idea/**/contentModel.xml
**/.idea/**/modules.xml
# ignore node_modules symlink
node_modules
node_modules.nosync

1
.idea/.name generated
View File

@@ -1 +0,0 @@
Sonarr

24
.idea/Sonarr.iml generated
View File

@@ -1,24 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.idea" />
<excludeFolder url="file://$MODULE_DIR$/Logo" />
<excludeFolder url="file://$MODULE_DIR$/_output" />
<excludeFolder url="file://$MODULE_DIR$/_output_mono" />
<excludeFolder url="file://$MODULE_DIR$/_output_osx" />
<excludeFolder url="file://$MODULE_DIR$/_output_osx_app" />
<excludeFolder url="file://$MODULE_DIR$/_start" />
<excludeFolder url="file://$MODULE_DIR$/_tests" />
<excludeFolder url="file://$MODULE_DIR$/debian" />
<excludeFolder url="file://$MODULE_DIR$/node_modules" />
<excludeFolder url="file://$MODULE_DIR$/osx" />
<excludeFolder url="file://$MODULE_DIR$/schemas" />
<excludeFolder url="file://$MODULE_DIR$/setup" />
<excludeFolder url="file://$MODULE_DIR$/src" />
<excludeFolder url="file://$MODULE_DIR$/tools" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@@ -1,59 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectCodeStyleSettingsManager">
<option name="PER_PROJECT_SETTINGS">
<value>
<option name="LINE_SEPARATOR" value="&#13;&#10;" />
<option name="RIGHT_MARGIN" value="190" />
<option name="HTML_ATTRIBUTE_WRAP" value="0" />
<option name="HTML_KEEP_LINE_BREAKS" value="false" />
<option name="HTML_KEEP_BLANK_LINES" value="1" />
<option name="HTML_ALIGN_ATTRIBUTES" value="false" />
<option name="HTML_INLINE_ELEMENTS" value="" />
<option name="HTML_DONT_ADD_BREAKS_IF_INLINE_CONTENT" value="" />
<CssCodeStyleSettings>
<option name="HEX_COLOR_LOWER_CASE" value="true" />
<option name="HEX_COLOR_LONG_FORMAT" value="true" />
<option name="VALUE_ALIGNMENT" value="1" />
</CssCodeStyleSettings>
<JSCodeStyleSettings>
<option name="SPACE_BEFORE_PROPERTY_COLON" value="true" />
<option name="ALIGN_OBJECT_PROPERTIES" value="2" />
<option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
<option name="OBJECT_LITERAL_WRAP" value="2" />
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
</JSCodeStyleSettings>
<XML>
<option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" />
</XML>
<codeStyleSettings language="CSS">
<indentOptions>
<option name="SMART_TABS" value="true" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="JavaScript">
<option name="LINE_COMMENT_AT_FIRST_COLUMN" value="true" />
<option name="KEEP_LINE_BREAKS" value="false" />
<option name="KEEP_FIRST_COLUMN_COMMENT" value="false" />
<option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
<option name="CATCH_ON_NEW_LINE" value="true" />
<option name="FINALLY_ON_NEW_LINE" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
<option name="SPACE_BEFORE_METHOD_PARENTHESES" value="true" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="BINARY_OPERATION_WRAP" value="1" />
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
<option name="ARRAY_INITIALIZER_WRAP" value="2" />
<option name="ARRAY_INITIALIZER_LBRACE_ON_NEXT_LINE" value="true" />
<option name="ARRAY_INITIALIZER_RBRACE_ON_NEXT_LINE" value="true" />
<option name="IF_BRACE_FORCE" value="3" />
<option name="DOWHILE_BRACE_FORCE" value="3" />
<option name="WHILE_BRACE_FORCE" value="3" />
<option name="FOR_BRACE_FORCE" value="3" />
</codeStyleSettings>
</value>
</option>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
</component>
</project>

6
.idea/encodings.xml generated
View File

@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="PROJECT" charset="UTF-8" />
</component>
</project>

View File

@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptLibraryMappings">
<excludedPredefinedLibrary name="Radarr/node_modules" />
</component>
</project>

14
.idea/misc.xml generated
View File

@@ -1,14 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" />
<OptionsSetting value="true" id="Checkout" />
<OptionsSetting value="true" id="Update" />
<OptionsSetting value="true" id="Status" />
<OptionsSetting value="true" id="Edit" />
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectRootManager" version="2" />
</project>

8
.idea/modules.xml generated
View File

@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/Sonarr.iml" filepath="$PROJECT_DIR$/.idea/Sonarr.iml" />
</modules>
</component>
</project>

6
.idea/vcs.xml generated
View File

@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

View File

@@ -1,16 +0,0 @@
language: csharp
solution: src/NzbDrone.sln
addons:
apt:
packages:
- nodejs
# - npm apparently not needed anymore.
script:
- ./build.sh
- chmod +x test.sh
# - ./test.sh Linux Unit Takes far too long, maybe even crashes travis :/
after_success:
- chmod +x package.sh
- ./package.sh
notifications:
- webhooks: https://discordapp.com/api/webhooks/266910310219251712/V-QvCcnYkg3O8PMevcAJOJyCgrYkZQoF2pupLDGbaISNUECmYPd6LRwl3avKHsPyfgWP

BIN
7za.dll

Binary file not shown.

BIN
7za.exe

Binary file not shown.

BIN
7zxa.dll

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 28 KiB

33
Logo/dottrace.svg Normal file
View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="70px" height="70px" viewBox="0 0 70 70" style="enable-background:new 0 0 70 70;" xml:space="preserve">
<g>
<g>
<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="-1.3318" y1="43.7371" x2="67.0419" y2="26.0967">
<stop offset="0.1237" style="stop-color:#7866FF"/>
<stop offset="0.5376" style="stop-color:#FE2EB6"/>
<stop offset="0.8548" style="stop-color:#FD0486"/>
</linearGradient>
<polygon style="fill:url(#SVGID_1_);" points="67.3,16 43.7,0 0,31.1 11.1,70 58.9,60.3 "/>
<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="45.9148" y1="38.9098" x2="67.6577" y2="9.0989">
<stop offset="0.1237" style="stop-color:#FF0080"/>
<stop offset="0.2587" style="stop-color:#FE0385"/>
<stop offset="0.4109" style="stop-color:#FA0C92"/>
<stop offset="0.5713" style="stop-color:#F41BA9"/>
<stop offset="0.7363" style="stop-color:#EB2FC8"/>
<stop offset="0.8656" style="stop-color:#E343E6"/>
</linearGradient>
<polygon style="fill:url(#SVGID_2_);" points="67.3,16 43.7,0 38,15.7 38,47.8 70,47.8 "/>
</g>
<g>
<rect x="13.4" y="13.4" style="fill:#000000;" width="43.2" height="43.2"/>
<rect x="17.4" y="48.5" style="fill:#FFFFFF;" width="16.2" height="2.7"/>
<g>
<path style="fill:#FFFFFF;" d="M17.4,19.1h6.9c5.6,0,9.5,3.8,9.5,8.9V28c0,5-3.9,8.9-9.5,8.9h-6.9V19.1z M21.4,22.7v10.7h3
c3.2,0,5.4-2.2,5.4-5.3V28c0-3.2-2.2-5.4-5.4-5.4H21.4z"/>
<polygon style="fill:#FFFFFF;" points="40.3,22.7 34.9,22.7 34.9,19.1 49.6,19.1 49.6,22.7 44.2,22.7 44.2,37 40.3,37 "/>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

66
Logo/jetbrains.svg Normal file
View File

@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="120.1px" height="130.2px" viewBox="0 0 120.1 130.2" style="enable-background:new 0 0 120.1 130.2;" xml:space="preserve"
>
<g>
<linearGradient id="XMLID_2_" gradientUnits="userSpaceOnUse" x1="31.8412" y1="120.5578" x2="110.2402" y2="73.24">
<stop offset="0" style="stop-color:#FCEE39"/>
<stop offset="1" style="stop-color:#F37B3D"/>
</linearGradient>
<path id="XMLID_3041_" style="fill:url(#XMLID_2_);" d="M118.6,71.8c0.9-0.8,1.4-1.9,1.5-3.2c0.1-2.6-1.8-4.7-4.4-4.9
c-1.2-0.1-2.4,0.4-3.3,1.1l0,0l-83.8,45.9c-1.9,0.8-3.6,2.2-4.7,4.1c-2.9,4.8-1.3,11,3.6,13.9c3.4,2,7.5,1.8,10.7-0.2l0,0l0,0
c0.2-0.2,0.5-0.3,0.7-0.5l78-54.8C117.3,72.9,118.4,72.1,118.6,71.8L118.6,71.8L118.6,71.8z"/>
<linearGradient id="XMLID_3_" gradientUnits="userSpaceOnUse" x1="48.3607" y1="6.9083" x2="119.9179" y2="69.5546">
<stop offset="0" style="stop-color:#EF5A6B"/>
<stop offset="0.57" style="stop-color:#F26F4E"/>
<stop offset="1" style="stop-color:#F37B3D"/>
</linearGradient>
<path id="XMLID_3049_" style="fill:url(#XMLID_3_);" d="M118.8,65.1L118.8,65.1L55,2.5C53.6,1,51.6,0,49.3,0
c-4.3,0-7.7,3.5-7.7,7.7v0c0,2.1,0.8,3.9,2.1,5.3l0,0l0,0c0.4,0.4,0.8,0.7,1.2,1l67.4,57.7l0,0c0.8,0.7,1.8,1.2,3,1.3
c2.6,0.1,4.7-1.8,4.9-4.4C120.2,67.3,119.7,66,118.8,65.1z"/>
<linearGradient id="XMLID_4_" gradientUnits="userSpaceOnUse" x1="52.9467" y1="63.6407" x2="10.5379" y2="37.1562">
<stop offset="0" style="stop-color:#7C59A4"/>
<stop offset="0.3852" style="stop-color:#AF4C92"/>
<stop offset="0.7654" style="stop-color:#DC4183"/>
<stop offset="0.957" style="stop-color:#ED3D7D"/>
</linearGradient>
<path id="XMLID_3042_" style="fill:url(#XMLID_4_);" d="M57.1,59.5C57,59.5,17.7,28.5,16.9,28l0,0l0,0c-0.6-0.3-1.2-0.6-1.8-0.9
c-5.8-2.2-12.2,0.8-14.4,6.6c-1.9,5.1,0.2,10.7,4.6,13.4l0,0l0,0C6,47.5,6.6,47.8,7.3,48c0.4,0.2,45.4,18.8,45.4,18.8l0,0
c1.8,0.8,3.9,0.3,5.1-1.2C59.3,63.7,59,61,57.1,59.5z"/>
<linearGradient id="XMLID_5_" gradientUnits="userSpaceOnUse" x1="52.1736" y1="3.7019" x2="10.7706" y2="37.8971">
<stop offset="0" style="stop-color:#EF5A6B"/>
<stop offset="0.364" style="stop-color:#EE4E72"/>
<stop offset="1" style="stop-color:#ED3D7D"/>
</linearGradient>
<path id="XMLID_3057_" style="fill:url(#XMLID_5_);" d="M49.3,0c-1.7,0-3.3,0.6-4.6,1.5L4.9,28.3c-0.1,0.1-0.2,0.1-0.2,0.2l-0.1,0
l0,0c-1.7,1.2-3.1,3-3.9,5.1C-1.5,39.4,1.5,45.9,7.3,48c3.6,1.4,7.5,0.7,10.4-1.4l0,0l0,0c0.7-0.5,1.3-1,1.8-1.6l34.6-31.2l0,0
c1.8-1.4,3-3.6,3-6.1v0C57.1,3.5,53.6,0,49.3,0z"/>
<g id="XMLID_3008_">
<rect id="XMLID_3033_" x="34.6" y="37.4" style="fill:#000000;" width="51" height="51"/>
<rect id="XMLID_3032_" x="39" y="78.8" style="fill:#FFFFFF;" width="19.1" height="3.2"/>
<g id="XMLID_3009_">
<path id="XMLID_3030_" style="fill:#FFFFFF;" d="M38.8,50.8l1.5-1.4c0.4,0.5,0.8,0.8,1.3,0.8c0.6,0,0.9-0.4,0.9-1.2l0-5.3l2.3,0
l0,5.3c0,1-0.3,1.8-0.8,2.3c-0.5,0.5-1.3,0.8-2.3,0.8C40.2,52.2,39.4,51.6,38.8,50.8z"/>
<path id="XMLID_3028_" style="fill:#FFFFFF;" d="M45.3,43.8l6.7,0v1.9l-4.4,0V47l4,0l0,1.8l-4,0l0,1.3l4.5,0l0,2l-6.7,0
L45.3,43.8z"/>
<path id="XMLID_3026_" style="fill:#FFFFFF;" d="M55,45.8l-2.5,0l0-2l7.3,0l0,2l-2.5,0l0,6.3l-2.3,0L55,45.8z"/>
<path id="XMLID_3022_" style="fill:#FFFFFF;" d="M39,54l4.3,0c1,0,1.8,0.3,2.3,0.7c0.3,0.3,0.5,0.8,0.5,1.4v0
c0,1-0.5,1.5-1.3,1.9c1,0.3,1.6,0.9,1.6,2v0c0,1.4-1.2,2.3-3.1,2.3l-4.3,0L39,54z M43.8,56.6c0-0.5-0.4-0.7-1-0.7l-1.5,0l0,1.5
l1.4,0C43.4,57.3,43.8,57.1,43.8,56.6L43.8,56.6z M43,59l-1.8,0l0,1.5H43c0.7,0,1.1-0.3,1.1-0.8v0C44.1,59.2,43.7,59,43,59z"/>
<path id="XMLID_3019_" style="fill:#FFFFFF;" d="M46.8,54l3.9,0c1.3,0,2.1,0.3,2.7,0.9c0.5,0.5,0.7,1.1,0.7,1.9v0
c0,1.3-0.7,2.1-1.7,2.6l2,2.9l-2.6,0l-1.7-2.5h-1l0,2.5l-2.3,0L46.8,54z M50.6,58c0.8,0,1.2-0.4,1.2-1v0c0-0.7-0.5-1-1.2-1
l-1.5,0v2H50.6z"/>
<path id="XMLID_3016_" style="fill:#FFFFFF;" d="M56.8,54l2.2,0l3.5,8.4l-2.5,0l-0.6-1.5l-3.2,0l-0.6,1.5l-2.4,0L56.8,54z
M58.8,59l-0.9-2.3L57,59L58.8,59z"/>
<path id="XMLID_3014_" style="fill:#FFFFFF;" d="M62.8,54l2.3,0l0,8.3l-2.3,0L62.8,54z"/>
<path id="XMLID_3012_" style="fill:#FFFFFF;" d="M65.7,54l2.1,0l3.4,4.4l0-4.4l2.3,0l0,8.3l-2,0L68,57.8l0,4.6l-2.3,0L65.7,54z"
/>
<path id="XMLID_3010_" style="fill:#FFFFFF;" d="M73.7,61.1l1.3-1.5c0.8,0.7,1.7,1,2.7,1c0.6,0,1-0.2,1-0.6v0
c0-0.4-0.3-0.5-1.4-0.8c-1.8-0.4-3.1-0.9-3.1-2.6v0c0-1.5,1.2-2.7,3.2-2.7c1.4,0,2.5,0.4,3.4,1.1l-1.2,1.6
c-0.8-0.5-1.6-0.8-2.3-0.8c-0.6,0-0.8,0.2-0.8,0.5v0c0,0.4,0.3,0.5,1.4,0.8c1.9,0.4,3.1,1,3.1,2.6v0c0,1.7-1.3,2.7-3.4,2.7
C76.1,62.5,74.7,62,73.7,61.1z"/>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.8 KiB

50
Logo/resharper.svg Normal file
View File

@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="70px" height="70px" viewBox="0 0 70 70" style="enable-background:new 0 0 70 70;" xml:space="preserve">
<g>
<g>
<g>
<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="22.9451" y1="75.7869" x2="74.7868" y2="20.6415">
<stop offset="1.612903e-002" style="stop-color:#B35BA3"/>
<stop offset="0.4044" style="stop-color:#C41E57"/>
<stop offset="0.4677" style="stop-color:#C41E57"/>
<stop offset="0.6505" style="stop-color:#EB8523"/>
<stop offset="0.9516" style="stop-color:#FEBD11"/>
</linearGradient>
<polygon style="fill:url(#SVGID_1_);" points="49.8,15.2 36,36.7 58.4,70 70,23.1 "/>
<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="17.7187" y1="73.2922" x2="69.5556" y2="18.1519">
<stop offset="1.612903e-002" style="stop-color:#B35BA3"/>
<stop offset="0.4044" style="stop-color:#C41E57"/>
<stop offset="0.4677" style="stop-color:#C41E57"/>
<stop offset="0.7043" style="stop-color:#EB8523"/>
</linearGradient>
<polygon style="fill:url(#SVGID_2_);" points="51.1,15.7 49,0 18.8,33.6 27.6,42.3 20.8,70 58.4,70 "/>
</g>
<linearGradient id="SVGID_3_" gradientUnits="userSpaceOnUse" x1="1.8281" y1="53.4275" x2="48.8245" y2="9.2255">
<stop offset="1.612903e-002" style="stop-color:#B35BA3"/>
<stop offset="0.6613" style="stop-color:#C41E57"/>
</linearGradient>
<polygon style="fill:url(#SVGID_3_);" points="49,0 11.6,0 0,47.1 55.6,47.1 "/>
<linearGradient id="SVGID_4_" gradientUnits="userSpaceOnUse" x1="49.8935" y1="-11.5569" x2="48.8588" y2="24.0352">
<stop offset="0.5" style="stop-color:#C41E57"/>
<stop offset="0.6668" style="stop-color:#D13F48"/>
<stop offset="0.7952" style="stop-color:#D94F39"/>
<stop offset="0.8656" style="stop-color:#DD5433"/>
</linearGradient>
<polygon style="fill:url(#SVGID_4_);" points="55.3,47.1 51.1,15.7 49,0 41.7,23 "/>
</g>
<g>
<rect x="13.4" y="13.5" transform="matrix(-1 2.577289e-003 -2.577289e-003 -1 70.0288 70.081)" style="fill:#000000;" width="43.2" height="43.2"/>
<rect x="17.6" y="48.6" transform="matrix(1 -2.577289e-003 2.577289e-003 1 -0.1287 6.634109e-002)" style="fill:#FFFFFF;" width="16.2" height="2.7"/>
<path style="fill:#FFFFFF;" d="M17.4,19.1l8.2,0c2.3,0,4,0.6,5.2,1.8c1,1,1.5,2.4,1.5,4.1l0,0.1c0,1.5-0.3,2.6-1.1,3.5
c-0.7,0.9-1.6,1.6-2.8,2l4.4,6.4l-4.6,0l-3.7-5.5l-3.3,0l0,5.5l-3.9,0L17.4,19.1z M25.3,27.8c1,0,1.7-0.2,2.2-0.7
c0.5-0.5,0.8-1.1,0.8-1.8l0-0.1c0-0.9-0.3-1.5-0.8-1.9c-0.5-0.4-1.3-0.6-2.3-0.6l-3.9,0l0,5.1L25.3,27.8z"/>
<path style="fill:#FFFFFF;" d="M36,33.2l-1.9,0l0-3.3l2.5,0l0.6-3.8l-2.3,0l0-3.3l2.8,0l0.6-3.7l3.4,0l-0.6,3.7l3.7,0l0.6-3.7
l3.4,0l-0.6,3.7l1.9,0l0,3.3l-2.5,0L47,29.9l2.3,0l0,3.3l-2.8,0L45.8,37l-3.4,0l0.7-3.8l-3.7,0L38.7,37l-3.4,0L36,33.2z
M43.7,29.9l0.6-3.8l-3.7,0L40,29.9L43.7,29.9z"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

42
Logo/rider.svg Normal file
View File

@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="70px" height="70px" viewBox="0 0 70 70" style="enable-background:new 0 0 70 70;" xml:space="preserve">
<defs>
<linearGradient id="linear-gradient" x1="70.22612" y1="27.79912" x2="-5.13024" y2="63.12242" gradientTransform="matrix(1, 0, 0, -1, 0, 71.27997)" gradientUnits="userSpaceOnUse">
<stop offset="0" stop-color="#c90f5e"/>
<stop offset="0.22111" stop-color="#c90f5e"/>
<stop offset="0.2356" stop-color="#c90f5e"/>
<stop offset="0.35559" stop-color="#ca135c"/>
<stop offset="0.46633" stop-color="#ce1e57"/>
<stop offset="0.5735" stop-color="#d4314e"/>
<stop offset="0.67844" stop-color="#dc4b41"/>
<stop offset="0.78179" stop-color="#e66d31"/>
<stop offset="0.88253" stop-color="#f3961d"/>
<stop offset="0.94241" stop-color="#fcb20f"/>
</linearGradient>
<linearGradient id="linear-gradient-2" x1="24.65904" y1="61.99608" x2="46.04762" y2="2.93445" gradientTransform="matrix(1, 0, 0, -1, 0, 71.27997)" gradientUnits="userSpaceOnUse">
<stop offset="0.04188" stop-color="#077cfb"/>
<stop offset="0.44503" stop-color="#c90f5e"/>
<stop offset="0.95812" stop-color="#077cfb"/>
</linearGradient>
<linearGradient id="linear-gradient-3" x1="17.39552" y1="63.34592" x2="33.19389" y2="7.20092" gradientTransform="matrix(1, 0, 0, -1, 0, 71.27997)" gradientUnits="userSpaceOnUse">
<stop offset="0.27749" stop-color="#c90f5e"/>
<stop offset="0.97382" stop-color="#fcb20f"/>
</linearGradient>
</defs>
<title>rider</title>
<g>
<polygon points="70 27.237 63.391 23.75 20.926 0 3.827 17.921 21.619 41.068 60.537 44.397 70 27.237" fill="url(#linear-gradient)"/>
<polygon points="50.423 16.132 44.271 1.107 27.643 17.471 11.768 50.194 49.411 70 70 57.98 50.423 16.132" fill="url(#linear-gradient-2)"/>
<polygon points="20.926 0 0 14.095 7.779 62.172 27.848 69.889 53.78 48.823 20.926 0" fill="url(#linear-gradient-3)"/>
</g>
<g>
<rect x="13.30219" y="13.19311" width="43.61371" height="43.61371"/>
<g>
<path d="M17.22741,18.86293h8.39564a7.38416,7.38416,0,0,1,5.34268,1.85358,5.86989,5.86989,0,0,1,1.52648,4.1433h0A5.74339,5.74339,0,0,1,28.567,30.5296l4.47041,6.54206H28.34891L24.42368,31.1838h-3.162v5.88785H17.22741V18.86293h0ZM25.296,27.69471c1.96262,0,3.053-1.09034,3.053-2.61682h0c0-1.74455-1.19938-2.61682-3.162-2.61682H21.15265v5.23365H25.296Z" fill="#fff"/>
<path d="M36.09034,18.86293H43.2866c5.77882,0,9.70405,3.92523,9.70405,9.15888h0c0,5.12461-3.92523,9.15888-9.70405,9.15888H36.09034V18.86293Zm4.03427,3.59813V33.47352h3.162a5.23727,5.23727,0,0,0,5.56075-5.45171h0a5.26493,5.26493,0,0,0-5.56075-5.56075h-3.162Z" fill="#fff"/>
</g>
<rect x="17.22741" y="48.62925" width="16.35514" height="2.72586" fill="#fff"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.0 KiB

36
Logo/webstorm.svg Normal file
View File

@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="70px" height="70px" viewBox="0 0 70 70" style="enable-background:new 0 0 70 70;" xml:space="preserve">
<g>
<g>
<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="25.0676" y1="1.4599" x2="43.1829" y2="66.675">
<stop offset="0.2849" style="stop-color:#00CDD7"/>
<stop offset="0.9409" style="stop-color:#2086D7"/>
</linearGradient>
<polygon style="fill:url(#SVGID_1_);" points="9.4,63.3 0,7.3 17.5,0.1 28.6,6.7 38.8,1.2 60.1,9.4 48.1,70 "/>
<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="30.7199" y1="9.7343" x2="61.365" y2="54.6713">
<stop offset="0.1398" style="stop-color:#FFF045"/>
<stop offset="0.3656" style="stop-color:#00CDD7"/>
</linearGradient>
<polygon style="fill:url(#SVGID_2_);" points="70,23.7 61,1.4 44.6,0 19.3,24.3 26.1,55.6 38.8,64.6 70,46 62.3,31.7 "/>
<linearGradient id="SVGID_3_" gradientUnits="userSpaceOnUse" x1="61.0819" y1="15.2899" x2="65.1065" y2="29.5436">
<stop offset="0.2849" style="stop-color:#00CDD7"/>
<stop offset="0.9409" style="stop-color:#2086D7"/>
</linearGradient>
<polygon style="fill:url(#SVGID_3_);" points="56,20.4 62.3,31.7 70,23.7 64.4,9.8 "/>
</g>
<g>
<g>
<rect x="13.4" y="13.4" style="fill:#000000;" width="43.2" height="43.2"/>
<rect x="17.5" y="48.5" style="fill:#FFFFFF;" width="16.2" height="2.7"/>
<path style="fill:#FFFFFF;" d="M38.7,34.3l2.3-2.8c1.6,1.3,3.3,2.2,5.3,2.2c1.6,0,2.5-0.6,2.5-1.7v-0.1c0-1-0.6-1.5-3.6-2.3
c-3.6-0.9-5.8-1.9-5.8-5.5v-0.1c0-3.3,2.6-5.4,6.2-5.4c2.6,0,4.8,0.8,6.6,2.3l-2,3c-1.6-1.1-3.1-1.8-4.6-1.8
c-1.5,0-2.3,0.7-2.3,1.6v0.1c0,1.2,0.8,1.6,3.8,2.4c3.6,1,5.6,2.3,5.6,5.4v0.1c0,3.6-2.7,5.6-6.5,5.6
C43.5,37.2,40.8,36.2,38.7,34.3"/>
</g>
<polygon style="fill:#FFFFFF;" points="35.2,19 32.5,29.4 29.5,19 26.5,19 23.4,29.4 20.7,19 16.6,19 21.7,36.9 25,36.9 28,26.5
30.9,36.9 34.3,36.9 39.4,19 "/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@@ -6,6 +6,8 @@ Radarr is an __independent__ fork of [Sonarr](https://github.com/Sonarr/Sonarr)
The project was inspired by other Usenet/BitTorrent movie downloaders such as CouchPotato.
See the [Roadmap blogpost](https://blog.radarr.video/development/update/2018/11/11/roadmap-update.html) for an overview of planned features.
## Getting Started
[![Installation](https://img.shields.io/badge/wiki-installation-brightgreen.svg?maxAge=60&style=flat-square)](https://github.com/Radarr/Radarr/wiki/Installation)
@@ -20,16 +22,19 @@ The project was inspired by other Usenet/BitTorrent movie downloaders such as Co
## Downloads
[![GitHub Releases](https://img.shields.io/badge/downloads-releases-brightgreen.svg?maxAge=60&style=flat-square)](https://github.com/Radarr/Radarr/releases)
[![AppVeyor Builds](https://img.shields.io/badge/downloads-continuous-green.svg?maxAge=60&style=flat-square)](https://ci.appveyor.com/project/galli-leo/radarr-usby1/branch/develop/artifacts)
Branch | develop (stable) | nightly (semi-unstable) |
---|---|---
Binary Releases | [![GitHub Releases](https://img.shields.io/badge/downloads-releases-brightgreen.svg?maxAge=60&style=flat-square)](https://github.com/Radarr/Radarr/releases) | [![AppVeyor Builds](https://img.shields.io/badge/downloads-continuous-green.svg?maxAge=60&style=flat-square)](https://ci.appveyor.com/project/galli-leo/radarr-usby1/branch/develop/artifacts)
Docker (linuxserver.io, x86_64, arm64, armhf) | [![Docker release](https://img.shields.io/badge/linuxserver-radarr:latest-blue.svg?colorB=1488C6&maxAge=60&style=flat-square)](https://store.docker.com/community/images/linuxserver/radarr) | [![Docker nightly](https://img.shields.io/badge/linuxserver-radarr:nightly-blue.svg?colorB=1488C6&maxAge=60&style=flat-square)](https://store.docker.com/community/images/linuxserver/radarr)
Docker (hotio, see [here](https://github.com/hotio/docker-radarr) for more information) | [![Docker release / nightly](https://img.shields.io/badge/docker-release/nightly-blue.svg?colorB=1488C6&maxAge=60&style=flat-square)](https://hub.docker.com/r/hotio/radarr) | [![Docker release / nightly](https://img.shields.io/badge/docker-release/nightly-blue.svg?colorB=1488C6&maxAge=60&style=flat-square)](https://hub.docker.com/r/hotio/radarr)
[![Docker release](https://img.shields.io/badge/docker-release-blue.svg?colorB=1488C6&maxAge=60&style=flat-square)](https://store.docker.com/community/images/linuxserver/radarr)
[![Docker nightly](https://img.shields.io/badge/docker-release/nightly-blue.svg?colorB=1488C6&maxAge=60&style=flat-square)](https://store.docker.com/community/images/hotio/suitarr)
[![Docker armhf](https://img.shields.io/badge/docker-armhf-blue.svg?colorB=1488C6&maxAge=60&style=flat-square)](https://store.docker.com/community/images/lsioarmhf/radarr)
[![Docker aarch64](https://img.shields.io/badge/docker-aarch64-blue.svg?colorB=1488C6&maxAge=60&style=flat-square)](https://store.docker.com/community/images/lsioarmhf/radarr-aarch64)
## Support
[![OpenCollective](https://opencollective.com/radarr/tiers/backer/badge.svg)](#backers)
[![OpenCollective](https://opencollective.com/radarr/tiers/flexible-sponsor/badge.svg)](#flexible-sponsors)
[![OpenCollective](https://opencollective.com/radarr/tiers/sponsor/badge.svg)](#sponsors)
[![Discord](https://img.shields.io/badge/discord-chat-7289DA.svg?maxAge=60&style=flat-square)](https://discord.gg/AD3UP37)
[![Reddit](https://img.shields.io/badge/reddit-discussion-FF4500.svg?maxAge=60&style=flat-square)](https://www.reddit.com/r/radarr)
[![Feathub](https://img.shields.io/badge/feathub-requests-lightgrey.svg?maxAge=60&style=flat-square)](http://feathub.com/Radarr/Radarr)
@@ -42,14 +47,22 @@ The project was inspired by other Usenet/BitTorrent movie downloaders such as Co
[![GitHub pull requests](https://img.shields.io/github/issues-pr/radarr/radarr.svg?maxAge=60&style=flat-square)](https://github.com/Radarr/Radarr/pulls)
[![GNU GPL v3](https://img.shields.io/badge/license-GNU%20GPL%20v3-blue.svg?maxAge=60&style=flat-square)](http://www.gnu.org/licenses/gpl.html)
[![Copyright 2010-2017](https://img.shields.io/badge/copyright-2017-blue.svg?maxAge=60&style=flat-square)](https://github.com/Radarr/Radarr)
[![Github Releases](https://img.shields.io/github/downloads/Radarr/Radarr/total.svg?maxAge=60&style=flat-square)](https://github.com/Radar/Radarr/releases/latest)
[![Github Releases](https://img.shields.io/github/downloads/Radarr/Radarr/total.svg?maxAge=60&style=flat-square)](https://github.com/Radarr/Radarr/releases/)
[![Docker Pulls](https://img.shields.io/docker/pulls/linuxserver/radarr.svg?maxAge=60&style=flat-square)](https://hub.docker.com/r/linuxserver/radarr/)
[![Changelog](https://img.shields.io/github/commit-activity/w/radarr/radarr.svg?style=flat-square)](/CHANGELOG.md#unreleased)
| Service | Master | Develop |
|----------|:---------------------------:|:----------------------------:|
| AppVeyor | [![AppVeyor](https://img.shields.io/appveyor/ci/galli-leo/Radarr/master.svg?maxAge=60&style=flat-square)](https://ci.appveyor.com/project/galli-leo/Radarr) | [![AppVeyor](https://img.shields.io/appveyor/ci/galli-leo/Radarr-usby1/develop.svg?maxAge=60&style=flat-square)](https://ci.appveyor.com/project/galli-leo/Radarr-usby1) |
| Travis | [![Travis](https://img.shields.io/travis/Radarr/Radarr/master.svg?maxAge=60&style=flat-square)](https://travis-ci.org/Radarr/Radarr) | [![Travis](https://img.shields.io/travis/Radarr/Radarr/develop.svg?maxAge=60&style=flat-square)](https://travis-ci.org/Radarr/Radarr) |
### [Site and API Status](https://status.radarr.video)
| API | Updates | Sites |
|-------|:----:|:----:|
| [![API V2 (develop)](http://status.radarr.video/component/1/shield?style=flat-square)](https://api.radarr.video/v2/) | [![Update Server](http://status.radarr.video/component/4/shield?style=flat-square)](https://radarr.aeonlucid.com) | [![Radarr Mappings](http://status.radarr.video/component/6/shield?style=flat-square)](https://mappings.radarr.video/)
| [![API Staging (nightly)](http://status.radarr.video/component/2/shield?style=flat-square)](https://staging.api.radarr.video/) | [![Github Updates](http://status.radarr.video/component/5/shield?style=flat-square)](https://api.github.com/v3/) | [![Main Site](http://status.radarr.video/component/7/shield?style=flat-square)](https://radarr.video/)
Radarr is currently undergoing rapid development and pull requests are actively added into the repository.
## Features
@@ -75,17 +88,13 @@ Radarr is currently undergoing rapid development and pull requests are actively
* Importing movies from various online sources, such as IMDb Watchlists (A complete list can be found [here](https://github.com/Radarr/Radarr/issues/114))
* Full integration with Kodi, Plex (notification, library update)
* And a beautiful UI
* Importing Metadata such as trailers or subtitles
* Adding metadata such as posters and information for Kodi and others to use
* Advanced customization for profiles, such that Radarr will always download the copy you want
### Planned Features
* Downloading Metadata such as trailers or subtitles (\*)
* Adding metadata such as posters and information for Kodi and others to use (\*)
* Dynamically renaming folders with quality info, etc. (\*)
* Supporting custom folder structures, such as all movie files in one folder (\*)
* Supporting multiple editions per movies (waiting on The Movie Database to finish their implementation)
* Supporting collections of movies, such as James Bond
**Note:** All features marked with (\*) are set to be in the first release of Radarr.
See the [Roadmap blogpost](https://blog.radarr.video/development/update/2018/11/11/roadmap-update.html) for an overview of planned features.
#### [Feature Requests](http://feathub.com/Radarr/Radarr)
@@ -93,7 +102,7 @@ Radarr is currently undergoing rapid development and pull requests are actively
### Requirements
* [Visual Studio Community](https://www.visualstudio.com/vs/community/) or [MonoDevelop](http://www.monodevelop.com)
* [Visual Studio Community 2017](https://www.visualstudio.com/vs/community/) or [Rider](http://www.jetbrains.com/rider/)
* [Git](https://git-scm.com/downloads)
* [Node.js](https://nodejs.org/en/download/)
@@ -108,12 +117,43 @@ Radarr is currently undergoing rapid development and pull requests are actively
> **Notice**
> Gulp must be running at all times while you are working with Radarr client source files.
### Build
* To build run `sh build.sh`
**Note:** Windows users must have bash available to do this. If you installed git, you should have a git bash utility that works.
### Development
* Open `NzbDrone.sln` in Visual Studio or run the build.sh script, if Mono is installed
* Open `NzbDrone.sln` in Visual Studio 2017 or run the build.sh script, if Mono is installed. Alternatively you can use Jetbrains Rider, since it works on all Platforms.
* Make sure `NzbDrone.Console` is set as the startup project
* Run `build.sh` before running
### License
## Supporters
This project would not be possible without the support by these amazing folks. [**Become a sponsor or backer**](https://opencollective.com/radarr) to help us out!
### Sponsors
[![Sponsors](https://opencollective.com/radarr/tiers/sponsor.svg)](https://opencollective.com/radarr/order/3851)
### Flexible Sponsors
[![Flexible Sponsors](https://opencollective.com/radarr/tiers/flexible-sponsor.svg?avatarHeight=54)](https://opencollective.com/radarr/order/3856)
### Backers
[![Backers](https://opencollective.com/radarr/tiers/backer.svg?avatarHeight=48)](https://opencollective.com/radarr/order/3850)
### JetBrains
Thank you to [<img src="/Logo/jetbrains.svg" alt="JetBrains" width="32"> JetBrains](http://www.jetbrains.com/) for providing us with free licenses to their great tools
* [<img src="/Logo/resharper.svg" alt="ReSharper" width="32"> ReSharper](http://www.jetbrains.com/resharper/)
* [<img src="/Logo/webstorm.svg" alt="WebStorm" width="32"> WebStorm](http://www.jetbrains.com/webstorm/)
* [<img src="/Logo/rider.svg" alt="Rider" width="32"> Rider](http://www.jetbrains.com/rider/)
* [<img src="/Logo/dottrace.svg" alt="dotTrace" width="32"> dotTrace](http://www.jetbrains.com/dottrace/)
## License
* [GNU GPL v3](http://www.gnu.org/licenses/gpl.html)
* Copyright 2010-2017
* Copyright 2010-2018

View File

@@ -1,53 +0,0 @@
version: '0.2.0.{build}'
assembly_info:
patch: true
file: 'src\NzbDrone.Common\Properties\SharedAssemblyInfo.cs'
assembly_version: '{version}'
assembly_file_version: '{version}'
assembly_informational_version: '{version}-rc1'
environment:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
install:
- git submodule update --init --recursive
build_script:
- ps: ./build-appveyor.ps1
test: off
#test:
# assemblies:
# - '_tests\*Test.dll'
# categories:
# except:
# - IntegrationTest
# - AutomationTest
artifacts:
- path: '_artifacts\*.zip'
- path: '_artifacts\*.exe'
- path: '_artifacts\*.tar.gz'
cache:
- '%USERPROFILE%\.nuget\packages'
- node_modules
pull_requests:
do_not_increment_build_number: true
on_failure:
- ps: Get-ChildItem .\_artifacts\*.zip | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
- ps: Get-ChildItem .\_artifacts\*.exe | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
- ps: Get-ChildItem .\_artifacts\*.tar.gz | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
only_commits:
files:
- src/
- osx/
- gulp/
- logo/
- setup/
- appveyor.yml
- build-appveyor.cake

431
azure-pipelines.yml Normal file
View File

@@ -0,0 +1,431 @@
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
variables:
outputFolder: './_output'
artifactsFolder: './_artifacts'
testsFolder: './_tests'
majorVersion: '0.2.0'
minorVersion: $[counter('minorVersionOld', 1510)]
radarrVersion: '$(majorVersion).$(minorVersion)'
buildName: '$(Build.SourceBranchName).$(radarrVersion)'
windowsInstaller: 'Radarr.$(buildName).windows-installer.exe'
windowsZip: 'Radarr.$(buildName).windows.zip'
macOsApp: 'Radarr.$(buildName).osx-app.zip'
macOsTar: 'Radarr.$(buildName).osx.tar.gz'
linuxTar: 'Radarr.$(buildName).linux.tar.gz'
trigger:
branches:
include:
- develop
- aphrodite
pr:
- develop
- aphrodite
stages:
- stage: Build_Backend
displayName: Build Backend
jobs:
- job: Backend
strategy:
matrix:
Linux:
osName: 'Linux'
imageName: 'ubuntu-18.04'
Mac:
osName: 'Mac'
imageName: 'macos-10.14'
Windows:
osName: 'Windows'
imageName: 'windows-2019'
pool:
vmImage: $(imageName)
steps:
# Set the build name properly. The 'name' property won't recursively expand so hack here:
- powershell: Write-Host "##vso[build.updatebuildnumber]$($env:RADARRVERSION)"
displayName: Set Build Name
- checkout: self
submodules: true
fetchDepth: 1
- task: Assembly-Info-NetFramework@2
displayName: Patch AssemblyInfo
inputs:
Path: '$(Build.SourcesDirectory)'
FileNames: 'src/NzbDrone.Common/Properties/SharedAssemblyInfo.cs'
InsertAttributes: false
FileEncoding: 'auto'
WriteBOM: false
Configuration: 'debug'
VersionNumber: '$(radarrVersion)'
FileVersionNumber: '$(radarrVersion)'
InformationalVersion: '$(radarrVersion)-rc1'
- bash: ./build.sh --only-backend
displayName: Build Radarr Backend
- publish: $(outputFolder)
artifact: '$(osName)Backend'
displayName: Publish Backend
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
- publish: $(testsFolder)
artifact: '$(osName)Tests'
displayName: Publish Test Package
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
- stage: Build_Frontend
displayName: Build Frontend
dependsOn: []
jobs:
- job: Frontend
strategy:
matrix:
Linux:
osName: 'Linux'
imageName: 'ubuntu-18.04'
Mac:
osName: 'Mac'
imageName: 'macos-10.14'
Windows:
osName: 'Windows'
imageName: 'windows-2019'
pool:
vmImage: $(imageName)
steps:
- task: NodeTool@0
displayName: Set Node.js version
inputs:
versionSpec: '10.x'
- checkout: self
submodules: true
fetchDepth: 1
- bash: ./build.sh --only-frontend
displayName: Build Radarr Frontend
env:
FORCE_COLOR: 0
- publish: $(outputFolder)
artifact: '$(osName)Frontend'
displayName: Publish Frontend
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
- stage: Package
dependsOn:
- Build_Backend
- Build_Frontend
jobs:
- job: Windows_Installer
displayName: Create Installer
pool:
vmImage: 'windows-2019'
steps:
- checkout: self
fetchDepth: 1
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
artifactName: WindowsBackend
targetPath: _output
displayName: Fetch Backend
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
artifactName: WindowsFrontend
targetPath: _output
displayName: Fetch Frontend
- bash: ./build.sh --only-packages
displayName: Create Packages
- bash: |
./setup/inno/ISCC.exe "./setup/radarr.iss"
cp ./setup/output/Radarr.*windows.exe ${BUILD_ARTIFACTSTAGINGDIRECTORY}/${WINDOWSINSTALLER}
displayName: Create Windows installer
- publish: $(Build.ArtifactStagingDirectory)
artifact: 'WindowsInstaller'
displayName: Publish Installer
- job: Other_Packages
displayName: Create Standard Packages
pool:
vmImage: 'ubuntu-18.04'
steps:
- checkout: self
fetchDepth: 1
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
artifactName: WindowsBackend
targetPath: _output
displayName: Fetch Backend
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
artifactName: WindowsFrontend
targetPath: _output
displayName: Fetch Frontend
- bash: ./build.sh --only-packages
displayName: Create Packages
- bash: |
chmod a+x $(artifactsFolder)/macos/Radarr/Radarr
chmod a+x $(artifactsFolder)/macos-app/Radarr.app/Contents/MacOS/Radarr
displayName: Set Mac executable bits
- task: ArchiveFiles@2
displayName: Create Windows zip
inputs:
archiveFile: '$(Build.ArtifactStagingDirectory)/$(windowsZip)'
archiveType: 'zip'
includeRootFolder: false
rootFolderOrFile: $(artifactsFolder)/windows
- task: ArchiveFiles@2
displayName: Create MacOS app
inputs:
archiveFile: '$(Build.ArtifactStagingDirectory)/$(macOsApp)'
archiveType: 'zip'
includeRootFolder: false
rootFolderOrFile: $(artifactsFolder)/macos-app
- task: ArchiveFiles@2
displayName: Create MacOS tar
inputs:
archiveFile: '$(Build.ArtifactStagingDirectory)/$(macOsTar)'
archiveType: 'tar'
tarCompression: 'gz'
includeRootFolder: false
rootFolderOrFile: $(artifactsFolder)/macos
- task: ArchiveFiles@2
displayName: Create Linux tar
inputs:
archiveFile: '$(Build.ArtifactStagingDirectory)/$(linuxTar)'
archiveType: 'tar'
tarCompression: 'gz'
includeRootFolder: false
rootFolderOrFile: $(artifactsFolder)/linux
- publish: $(Build.ArtifactStagingDirectory)
artifact: 'Packages'
displayName: Publish Packages
- stage: Unit_Test
displayName: Unit Tests
dependsOn: Build_Backend
condition: succeeded()
jobs:
- job: Unit
strategy:
matrix:
Linux:
osName: 'Linux'
imageName: 'ubuntu-18.04'
Mac:
osName: 'Mac'
imageName: 'macos-10.14'
Windows:
osName: 'Windows'
imageName: 'windows-2019'
pool:
vmImage: $(imageName)
steps:
- checkout: none
- task: DownloadPipelineArtifact@2
displayName: Download Test Artifact
inputs:
buildType: 'current'
artifactName: WindowsTests
targetPath: $(testsFolder)
- bash: |
wget https://mediaarea.net/repo/deb/repo-mediaarea_1.0-11_all.deb
sudo dpkg -i repo-mediaarea_1.0-11_all.deb
sudo apt-get update
sudo apt-get install -y --allow-unauthenticated libmediainfo-dev libmediainfo0v5 mediainfo
displayName: Install mediainfo
condition: and(succeeded(), eq(variables['osName'], 'Linux'))
- powershell: Set-Service SCardSvr -StartupType Manual
displayName: Enable Windows Test Service
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
- bash: |
chmod a+x ${TESTSFOLDER}/test.sh
${TESTSFOLDER}/test.sh ${OSNAME} Unit Test
displayName: Run Unit Tests
- publish: TestResult.xml
artifact: 'TestResult'
displayName: Publish Test Result
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
- task: PublishTestResults@2
displayName: Publish Test Results
inputs:
testResultsFormat: 'NUnit'
testResultsFiles: '**/TestResult.xml'
testRunTitle: '$(osName) Unit Tests'
failTaskOnFailedTests: true
- stage: Integration
displayName: Integration
dependsOn: Package
jobs:
- job: Integration
strategy:
matrix:
Linux:
osName: 'Linux'
imageName: 'ubuntu-18.04'
pattern: 'Radarr.**.linux.tar.gz'
Mac:
osName: 'Mac'
imageName: 'macos-10.14'
pattern: 'Radarr.**.osx.tar.gz'
Windows:
osName: 'Windows'
imageName: 'windows-2019'
pattern: 'Radarr.**.windows.zip'
pool:
vmImage: $(imageName)
steps:
- bash: |
SYMLINK=5_18_1
MONOPREFIX=/Library/Frameworks/Mono.framework/Versions/$SYMLINK
echo "##vso[task.setvariable variable=MONOPREFIX;]$MONOPREFIX"
echo "##vso[task.setvariable variable=PKG_CONFIG_PATH;]$MONOPREFIX/lib/pkgconfig:$MONOPREFIX/share/pkgconfig:$PKG_CONFIG_PATH"
echo "##vso[task.setvariable variable=PATH;]$MONOPREFIX/bin:$PATH"
displayName: Set Mono Version
condition: and(succeeded(), eq(variables['osName'], 'Mac'))
- checkout: none
- task: DownloadPipelineArtifact@2
displayName: Download Test Artifact
inputs:
buildType: 'current'
artifactName: WindowsTests
targetPath: $(testsFolder)
- task: DownloadPipelineArtifact@2
displayName: Download Build Artifact
inputs:
buildType: 'current'
artifactName: Packages
itemPattern: '**/$(pattern)'
targetPath: $(Build.ArtifactStagingDirectory)
- task: ExtractFiles@1
inputs:
archiveFilePatterns: '$(Build.ArtifactStagingDirectory)/**/$(pattern)'
destinationFolder: '$(Build.ArtifactStagingDirectory)/bin'
displayName: Extract Package
- bash: |
mkdir -p ./bin/
cp -r -v ${BUILD_ARTIFACTSTAGINGDIRECTORY}/bin/Radarr/. ./bin/
displayName: Move Package Contents
- bash: |
ls -lR
chmod a+x ${TESTSFOLDER}/test.sh
${TESTSFOLDER}/test.sh ${OSNAME} Integration Test
displayName: Run Integration Tests
- task: PublishTestResults@2
inputs:
testResultsFormat: 'NUnit'
testResultsFiles: '**/TestResult.xml'
testRunTitle: '$(osName) Integration Tests'
failTaskOnFailedTests: true
displayName: Publish Test Results
- stage: Automation
displayName: Automation
dependsOn: Package
jobs:
- job: Automation
strategy:
matrix:
Linux:
osName: 'Linux'
imageName: 'ubuntu-18.04'
pattern: 'Radarr.**.linux.tar.gz'
failBuild: true
Mac:
osName: 'Mac'
imageName: 'macos-10.14' # Fails due to firefox not being installed on image
pattern: 'Radarr.**.osx.tar.gz'
failBuild: true
Windows:
osName: 'Windows'
imageName: 'windows-2019'
pattern: 'Radarr.**.windows.zip'
failBuild: true
pool:
vmImage: $(imageName)
steps:
- checkout: none
- task: DownloadPipelineArtifact@2
displayName: Download Test Artifact
inputs:
buildType: 'current'
artifactName: WindowsTests
targetPath: $(testsFolder)
- task: DownloadPipelineArtifact@2
displayName: Download Build Artifact
inputs:
buildType: 'current'
artifactName: Packages
itemPattern: '**/$(pattern)'
targetPath: $(Build.ArtifactStagingDirectory)
- task: ExtractFiles@1
inputs:
archiveFilePatterns: '$(Build.ArtifactStagingDirectory)/**/$(pattern)'
destinationFolder: '$(Build.ArtifactStagingDirectory)/bin'
displayName: Extract Package
- bash: |
mkdir -p ./bin/
cp -r -v ${BUILD_ARTIFACTSTAGINGDIRECTORY}/bin/Radarr/. ./bin/
displayName: Move Package Contents
- bash: |
if [[ $OSNAME == "Mac" ]]; then
url=https://github.com/mozilla/geckodriver/releases/download/v0.26.0/geckodriver-v0.26.0-macos.tar.gz
elif [[ $OSNAME == "Linux" ]]; then
url=https://github.com/mozilla/geckodriver/releases/download/v0.26.0/geckodriver-v0.26.0-linux64.tar.gz
else
echo "Unhandled OS"
exit 1
fi
curl -s -L "$url" | tar -xz
chmod +x geckodriver
mv geckodriver _tests
displayName: Install Gecko Driver
condition: and(succeeded(), ne(variables['osName'], 'Windows'))
- bash: ls -lR
- bash: |
chmod a+x ${TESTSFOLDER}/test.sh
${TESTSFOLDER}/test.sh ${OSNAME} Automation
displayName: Run Automation Tests
- task: PublishTestResults@2
inputs:
testResultsFormat: 'NUnit'
testResultsFiles: '**/TestResult.xml'
testRunTitle: '$(osName) Automation Tests'
failTaskOnFailedTests: $(failBuild)
displayName: Publish Test Results
- stage: Report_Out
dependsOn:
- Unit_Test
- Integration
- Automation
condition: eq(variables['system.pullrequest.isfork'], false)
displayName: Build Status Report
jobs:
- job:
displayName: Discord Notification
pool:
vmImage: 'ubuntu-18.04'
steps:
- checkout: none
- powershell: |
iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/Servarr/AzureDiscordNotify/master/DiscordNotify.ps1'))
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
DISCORDCHANNELID: $(discordChannelId)
DISCORDWEBHOOKKEY: $(discordWebhookKey)

View File

@@ -1,319 +0,0 @@
#addin "Cake.Npm"
#addin "SharpZipLib"
#addin "Cake.Compression"
// Build variables
var outputFolder = "./_output";
var outputFolderMono = outputFolder + "_mono";
var outputFolderOsx = outputFolder + "_osx";
var outputFolderOsxApp = outputFolderOsx + "_app";
var testPackageFolder = "./_tests";
var testSearchPattern = "*.Test/bin/x86/Release";
var sourceFolder = "./src";
var solutionFile = sourceFolder + "/NzbDrone.sln";
var updateFolder = outputFolder + "/NzbDrone.Update";
var updateFolderMono = outputFolderMono + "/NzbDrone.Update";
// Artifact variables
var artifactsFolder = "./_artifacts";
var artifactsFolderWindows = artifactsFolder + "/windows";
var artifactsFolderLinux = artifactsFolder + "/linux";
var artifactsFolderOsx = artifactsFolder + "/osx";
var artifactsFolderOsxApp = artifactsFolder + "/osx-app";
// Utility methods
public void RemoveEmptyFolders(string startLocation) {
foreach (var directory in System.IO.Directory.GetDirectories(startLocation))
{
RemoveEmptyFolders(directory);
if (System.IO.Directory.GetFiles(directory).Length == 0 &&
System.IO.Directory.GetDirectories(directory).Length == 0)
{
DeleteDirectory(directory, false);
}
}
}
public void CleanFolder(string path, bool keepConfigFiles) {
DeleteFiles(path + "/**/*.transform");
if (!keepConfigFiles) {
DeleteFiles(path + "/**/*.dll.config");
}
DeleteFiles(path + "/**/FluentValidation.resources.dll");
DeleteFiles(path + "/**/App.config");
DeleteFiles(path + "/**/*.less");
DeleteFiles(path + "/**/*.vshost.exe");
DeleteFiles(path + "/**/*.dylib");
RemoveEmptyFolders(path);
}
public void CreateMdbs(string path) {
foreach (var file in System.IO.Directory.EnumerateFiles(path, "*.pdb", System.IO.SearchOption.AllDirectories)) {
var actualFile = file.Substring(0, file.Length - 4);
if (FileExists(actualFile + ".exe")) {
StartProcess("./tools/pdb2mdb/pdb2mdb.exe", new ProcessSettings()
.WithArguments(args => args.Append(actualFile + ".exe")));
}
if (FileExists(actualFile + ".dll")) {
StartProcess("./tools/pdb2mdb/pdb2mdb.exe", new ProcessSettings()
.WithArguments(args => args.Append(actualFile + ".dll")));
}
}
}
// Build Tasks
Task("Compile").Does(() => {
// Build
if (DirectoryExists(outputFolder)) {
DeleteDirectory(outputFolder, true);
}
MSBuild(solutionFile, config =>
config.UseToolVersion(MSBuildToolVersion.VS2015)
.WithTarget("Clean")
.SetVerbosity(Verbosity.Minimal));
NuGetRestore(solutionFile);
MSBuild(solutionFile, config =>
config.UseToolVersion(MSBuildToolVersion.VS2015)
.SetPlatformTarget(PlatformTarget.x86)
.SetConfiguration("Release")
.WithProperty("AllowedReferenceRelatedFileExtensions", new string[] { ".pdb" })
.WithTarget("Build")
.SetVerbosity(Verbosity.Minimal));
CleanFolder(outputFolder, false);
// Add JsonNet
DeleteFiles(outputFolder + "/Newtonsoft.Json.*");
CopyFiles(sourceFolder + "/packages/Newtonsoft.Json.*/lib/net35/*.dll", outputFolder);
CopyFiles(sourceFolder + "/packages/Newtonsoft.Json.*/lib/net35/*.dll", updateFolder);
// Remove Mono stuff
DeleteFile(outputFolder + "/Mono.Posix.dll");
});
Task("Gulp").Does(() => {
NpmInstall(new NpmInstallSettings {
LogLevel = NpmLogLevel.Silent,
WorkingDirectory = "./",
Production = true
});
NpmRunScript("build");
});
Task("PackageMono").Does(() => {
// Start mono package
if (DirectoryExists(outputFolderMono)) {
DeleteDirectory(outputFolderMono, true);
}
CopyDirectory(outputFolder, outputFolderMono);
// Create MDBs
CreateMdbs(outputFolderMono);
// Remove PDBs
DeleteFiles(outputFolderMono + "/**/*.pdb");
// Remove service helpers
DeleteFiles(outputFolderMono + "/ServiceUninstall.*");
DeleteFiles(outputFolderMono + "/ServiceInstall.*");
// Remove native windows binaries
DeleteFiles(outputFolderMono + "/sqlite3.*");
DeleteFiles(outputFolderMono + "/MediaInfo.*");
// Adding NzbDrone.Core.dll.config (for dllmap)
CopyFile(sourceFolder + "/NzbDrone.Core/NzbDrone.Core.dll.config", outputFolderMono + "/NzbDrone.Core.dll.config");
// Adding CurlSharp.dll.config (for dllmap)
CopyFile(sourceFolder + "/NzbDrone.Common/CurlSharp.dll.config", outputFolderMono + "/CurlSharp.dll.config");
// Renaming Radarr.Console.exe to Radarr.exe
DeleteFiles(outputFolderMono + "/Radarr.exe*");
MoveFile(outputFolderMono + "/Radarr.Console.exe", outputFolderMono + "/Radarr.exe");
MoveFile(outputFolderMono + "/Radarr.Console.exe.config", outputFolderMono + "/Radarr.exe.config");
MoveFile(outputFolderMono + "/Radarr.Console.exe.mdb", outputFolderMono + "/Radarr.exe.mdb");
// Remove NzbDrone.Windows.*
DeleteFiles(outputFolderMono + "/NzbDrone.Windows.*");
// Adding NzbDrone.Mono to updatePackage
CopyFiles(outputFolderMono + "/NzbDrone.Mono.*", updateFolderMono);
});
Task("PackageOsx").Does(() => {
// Start osx package
if (DirectoryExists(outputFolderOsx)) {
DeleteDirectory(outputFolderOsx, true);
}
CopyDirectory(outputFolderMono, outputFolderOsx);
// Adding sqlite dylibs
CopyFiles(sourceFolder + "/Libraries/Sqlite/*.dylib", outputFolderOsx);
// Adding MediaInfo dylib
CopyFiles(sourceFolder + "/Libraries/MediaInfo/*.dylib", outputFolderOsx);
// Chmod as executable
StartProcess(@"C:\cygwin64\bin\chmod.exe", new ProcessSettings()
.WithArguments(args => args
.Append("+x")
.Append(outputFolderOsx + "/Radarr")));
// Adding Startup script
CopyFile("./osx/Radarr", outputFolderOsx + "/Radarr");
});
Task("PackageOsxApp").Does(() => {
// Start osx app package
if (DirectoryExists(outputFolderOsxApp)) {
DeleteDirectory(outputFolderOsxApp, true);
}
CreateDirectory(outputFolderOsxApp);
// Copy osx package files
CopyDirectory("./osx/Radarr.app", outputFolderOsxApp + "/Radarr.app");
CopyDirectory(outputFolderOsx, outputFolderOsxApp + "/Radarr.app/Contents/MacOS");
});
Task("PackageTests").Does(() => {
// Start tests package
if (DirectoryExists(testPackageFolder)) {
DeleteDirectory(testPackageFolder, true);
}
CreateDirectory(testPackageFolder);
// Copy tests
CopyFiles(sourceFolder + "/" + testSearchPattern + "/*", testPackageFolder);
foreach (var directory in System.IO.Directory.GetDirectories(sourceFolder, "*.Test")) {
var releaseDirectory = directory + "/bin/x86/Release";
if (DirectoryExists(releaseDirectory)) {
foreach (var releaseSubDirectory in System.IO.Directory.GetDirectories(releaseDirectory)) {
Information(System.IO.Path.GetDirectoryName(releaseSubDirectory));
CopyDirectory(releaseSubDirectory, testPackageFolder + "/" + System.IO.Path.GetFileName(releaseSubDirectory));
}
}
}
// Install NUnit.ConsoleRunner
NuGetInstall("NUnit.ConsoleRunner", new NuGetInstallSettings {
Version = "3.2.0",
OutputDirectory = testPackageFolder
});
// Copy dlls
CopyFiles(outputFolder + "/*.dll", testPackageFolder);
// Copy scripts
CopyFiles("./*.sh", testPackageFolder);
// Create MDBs for tests
CreateMdbs(testPackageFolder);
// Remove config
DeleteFiles(testPackageFolder + "/*.log.config");
// Clean
CleanFolder(testPackageFolder, true);
// Adding NzbDrone.Core.dll.config (for dllmap)
CopyFile(sourceFolder + "/NzbDrone.Core/NzbDrone.Core.dll.config", testPackageFolder + "/NzbDrone.Core.dll.config");
// Adding CurlSharp.dll.config (for dllmap)
CopyFile(sourceFolder + "/NzbDrone.Common/CurlSharp.dll.config", testPackageFolder + "/CurlSharp.dll.config");
// Adding CurlSharp libraries
CopyFiles(sourceFolder + "/ExternalModules/CurlSharp/libs/i386/*", testPackageFolder);
});
Task("CleanupWindowsPackage").Does(() => {
// Remove mono
DeleteFiles(outputFolder + "/NzbDrone.Mono.*");
// Adding NzbDrone.Windows to updatePackage
CopyFiles(outputFolder + "/NzbDrone.Windows.*", updateFolder);
});
Task("Build")
.IsDependentOn("Compile")
.IsDependentOn("Gulp")
.IsDependentOn("PackageMono")
.IsDependentOn("PackageOsx")
.IsDependentOn("PackageOsxApp")
.IsDependentOn("PackageTests")
.IsDependentOn("CleanupWindowsPackage");
// Build Artifacts
Task("CleanArtifacts").Does(() => {
if (DirectoryExists(artifactsFolder)) {
DeleteDirectory(artifactsFolder, true);
}
CreateDirectory(artifactsFolder);
});
Task("ArtifactsWindows").Does(() => {
CopyDirectory(outputFolder, artifactsFolderWindows + "/Radarr");
});
Task("ArtifactsWindowsInstaller").Does(() => {
InnoSetup("./setup/nzbdrone.iss", new InnoSetupSettings {
OutputDirectory = artifactsFolder,
ToolPath = "./setup/inno/ISCC.exe"
});
});
Task("ArtifactsLinux").Does(() => {
CopyDirectory(outputFolderMono, artifactsFolderLinux + "/Radarr");
});
Task("ArtifactsOsx").Does(() => {
CopyDirectory(outputFolderOsx, artifactsFolderOsx + "/Radarr");
});
Task("ArtifactsOsxApp").Does(() => {
CopyDirectory(outputFolderOsxApp, artifactsFolderOsxApp);
});
Task("CompressArtifacts").Does(() => {
var prefix = "";
if (AppVeyor.IsRunningOnAppVeyor) {
prefix += AppVeyor.Environment.Repository.Branch.Replace("/", "-") + ".";
prefix += AppVeyor.Environment.Build.Version + ".";
}
Zip(artifactsFolderWindows, artifactsFolder + "/Radarr." + prefix + "windows.zip");
GZipCompress(artifactsFolderLinux, artifactsFolder + "/Radarr." + prefix + "linux.tar.gz");
GZipCompress(artifactsFolderOsx, artifactsFolder + "/Radarr." + prefix + "osx.tar.gz");
Zip(artifactsFolderOsxApp, artifactsFolder + "/Radarr." + prefix + "osx-app.zip");
});
Task("Artifacts")
.IsDependentOn("CleanArtifacts")
.IsDependentOn("ArtifactsWindows")
.IsDependentOn("ArtifactsWindowsInstaller")
.IsDependentOn("ArtifactsLinux")
.IsDependentOn("ArtifactsOsx")
.IsDependentOn("ArtifactsOsxApp")
.IsDependentOn("CompressArtifacts");
// Run
RunTarget("Build");
RunTarget("Artifacts");

View File

@@ -1,184 +0,0 @@
##########################################################################
# This is the Cake bootstrapper script for PowerShell.
# This file was downloaded from https://github.com/cake-build/resources
# Feel free to change this file to fit your needs.
##########################################################################
<#
.SYNOPSIS
This is a Powershell script to bootstrap a Cake build.
.DESCRIPTION
This Powershell script will download NuGet if missing, restore NuGet tools (including Cake)
and execute your Cake build script with the parameters you provide.
.PARAMETER Script
The build script to execute.
.PARAMETER Target
The build script target to run.
.PARAMETER Configuration
The build configuration to use.
.PARAMETER Verbosity
Specifies the amount of information to be displayed.
.PARAMETER Experimental
Tells Cake to use the latest Roslyn release.
.PARAMETER WhatIf
Performs a dry run of the build script.
No tasks will be executed.
.PARAMETER Mono
Tells Cake to use the Mono scripting engine.
.PARAMETER SkipToolPackageRestore
Skips restoring of packages.
.PARAMETER ScriptArgs
Remaining arguments are added here.
.LINK
http://cakebuild.net
#>
[CmdletBinding()]
Param(
[string]$Script = "build-appveyor.cake",
[string]$Target = "Default",
[ValidateSet("Release", "Debug")]
[string]$Configuration = "Release",
[ValidateSet("Quiet", "Minimal", "Normal", "Verbose", "Diagnostic")]
[string]$Verbosity = "Verbose",
[switch]$Experimental,
[Alias("DryRun","Noop")]
[switch]$WhatIf,
[switch]$Mono,
[switch]$SkipToolPackageRestore,
[Parameter(Position=0,Mandatory=$false,ValueFromRemainingArguments=$true)]
[string[]]$ScriptArgs
)
[Reflection.Assembly]::LoadWithPartialName("System.Security") | Out-Null
function MD5HashFile([string] $filePath)
{
if ([string]::IsNullOrEmpty($filePath) -or !(Test-Path $filePath -PathType Leaf))
{
return $null
}
[System.IO.Stream] $file = $null;
[System.Security.Cryptography.MD5] $md5 = $null;
try
{
$md5 = [System.Security.Cryptography.MD5]::Create()
$file = [System.IO.File]::OpenRead($filePath)
return [System.BitConverter]::ToString($md5.ComputeHash($file))
}
finally
{
if ($file -ne $null)
{
$file.Dispose()
}
}
}
Write-Host "Preparing to run build script..."
if(!$PSScriptRoot){
$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent
}
$TOOLS_DIR = Join-Path $PSScriptRoot "tools-cake"
$NUGET_EXE = Join-Path $TOOLS_DIR "nuget.exe"
$CAKE_EXE = Join-Path $TOOLS_DIR "Cake/Cake.exe"
$NUGET_URL = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"
$PACKAGES_CONFIG = Join-Path $TOOLS_DIR "packages.config"
$PACKAGES_CONFIG_MD5 = Join-Path $TOOLS_DIR "packages.config.md5sum"
# Should we use mono?
$UseMono = "";
if($Mono.IsPresent) {
Write-Verbose -Message "Using the Mono based scripting engine."
$UseMono = "-mono"
}
# Should we use the new Roslyn?
$UseExperimental = "";
if($Experimental.IsPresent -and !($Mono.IsPresent)) {
Write-Verbose -Message "Using experimental version of Roslyn."
$UseExperimental = "-experimental"
}
# Is this a dry run?
$UseDryRun = "";
if($WhatIf.IsPresent) {
$UseDryRun = "-dryrun"
}
# Make sure tools folder exists
if ((Test-Path $PSScriptRoot) -and !(Test-Path $TOOLS_DIR)) {
Write-Verbose -Message "Creating tools directory..."
New-Item -Path $TOOLS_DIR -Type directory | out-null
}
# Make sure that packages.config exist.
if (!(Test-Path $PACKAGES_CONFIG)) {
Write-Verbose -Message "Downloading packages.config..."
try { (New-Object System.Net.WebClient).DownloadFile("http://cakebuild.net/download/bootstrapper/packages", $PACKAGES_CONFIG) } catch {
Throw "Could not download packages.config."
}
}
# Try find NuGet.exe in path if not exists
if (!(Test-Path $NUGET_EXE)) {
Write-Verbose -Message "Trying to find nuget.exe in PATH..."
$existingPaths = $Env:Path -Split ';' | Where-Object { (![string]::IsNullOrEmpty($_)) -and (Test-Path $_) }
$NUGET_EXE_IN_PATH = Get-ChildItem -Path $existingPaths -Filter "nuget.exe" | Select -First 1
if ($NUGET_EXE_IN_PATH -ne $null -and (Test-Path $NUGET_EXE_IN_PATH.FullName)) {
Write-Verbose -Message "Found in PATH at $($NUGET_EXE_IN_PATH.FullName)."
$NUGET_EXE = $NUGET_EXE_IN_PATH.FullName
}
}
# Try download NuGet.exe if not exists
if (!(Test-Path $NUGET_EXE)) {
Write-Verbose -Message "Downloading NuGet.exe..."
try {
(New-Object System.Net.WebClient).DownloadFile($NUGET_URL, $NUGET_EXE)
} catch {
Throw "Could not download NuGet.exe."
}
}
# Save nuget.exe path to environment to be available to child processed
$ENV:NUGET_EXE = $NUGET_EXE
# Restore tools from NuGet?
if(-Not $SkipToolPackageRestore.IsPresent) {
Push-Location
Set-Location $TOOLS_DIR
# Check for changes in packages.config and remove installed tools if true.
[string] $md5Hash = MD5HashFile($PACKAGES_CONFIG)
if((!(Test-Path $PACKAGES_CONFIG_MD5)) -Or
($md5Hash -ne (Get-Content $PACKAGES_CONFIG_MD5 ))) {
Write-Verbose -Message "Missing or changed package.config hash..."
Remove-Item * -Recurse -Exclude packages.config,nuget.exe
}
Write-Verbose -Message "Restoring tools from NuGet..."
$NuGetOutput = Invoke-Expression "&`"$NUGET_EXE`" install -ExcludeVersion -OutputDirectory `"$TOOLS_DIR`""
if ($LASTEXITCODE -ne 0) {
Throw "An error occured while restoring NuGet tools."
}
else
{
$md5Hash | Out-File $PACKAGES_CONFIG_MD5 -Encoding "ASCII"
}
Write-Verbose -Message ($NuGetOutput | out-string)
Pop-Location
}
# Make sure that Cake has been installed.
if (!(Test-Path $CAKE_EXE)) {
Throw "Could not find Cake.exe at $CAKE_EXE"
}
# Start Cake
Write-Host "Running build script..."
Invoke-Expression "& `"$CAKE_EXE`" `"$Script`" -target=`"$Target`" -configuration=`"$Configuration`" -verbosity=`"$Verbosity`" $UseMono $UseDryRun $UseExperimental $ScriptArgs"
exit $LASTEXITCODE

View File

@@ -1 +0,0 @@
Write-Warning "DEPRECATED -- Please use build.sh instead."

291
build.sh
View File

@@ -1,17 +1,25 @@
#! /bin/bash
msBuild='/c/Program Files (x86)/MSBuild/14.0/Bin'
msBuildVersion='15.0'
outputFolder='./_output'
outputFolderMono='./_output_mono'
outputFolderOsx='./_output_osx'
outputFolderOsxApp='./_output_osx_app'
outputFolderLinux='./_output_linux'
outputFolderMacOS='./_output_macos'
outputFolderMacOSApp='./_output_macos_app'
testPackageFolder='./_tests/'
testSearchPattern='*.Test/bin/x86/Release'
testSearchPattern='*.Test/bin/x86/Release/*'
sourceFolder='./src'
slnFile=$sourceFolder/NzbDrone.sln
updateFolder=$outputFolder/NzbDrone.Update
updateFolderMono=$outputFolderMono/NzbDrone.Update
updateFolderMono=$outputFolderLinux/NzbDrone.Update
#Artifact variables
artifactsFolder="./_artifacts";
artifactsFolderWindows=$artifactsFolder/windows
artifactsFolderLinux=$artifactsFolder/linux
artifactsFolderMacOS=$artifactsFolder/macos
artifactsFolderMacOSApp=$artifactsFolder/macos-app
nuget='tools/nuget/nuget.exe';
vswhere='tools/vswhere/vswhere.exe';
CheckExitCode()
{
"$@"
@@ -23,12 +31,21 @@ CheckExitCode()
return $status
}
ProgressStart()
{
echo "Start '$1'"
}
ProgressEnd()
{
echo "Finish '$1'"
}
CleanFolder()
{
local path=$1
local keepConfigFiles=$2
find $path -name "*.transform" -exec rm "{}" \;
if [ $keepConfigFiles != true ] ; then
@@ -39,9 +56,6 @@ CleanFolder()
find $path -name "FluentValidation.resources.dll" -exec rm "{}" \;
find $path -name "App.config" -exec rm "{}" \;
echo "Removing .less files"
find $path -name "*.less" -exec rm "{}" \;
echo "Removing vshost files"
find $path -name "*.vshost.exe" -exec rm "{}" \;
@@ -52,19 +66,16 @@ CleanFolder()
find $path -depth -empty -type d -exec rm -r "{}" \;
}
AddJsonNet()
{
rm $outputFolder/Newtonsoft.Json.*
cp $sourceFolder/packages/Newtonsoft.Json.*/lib/net35/*.dll $outputFolder
cp $sourceFolder/packages/Newtonsoft.Json.*/lib/net35/*.dll $outputFolder/NzbDrone.Update
}
BuildWithMSBuild()
{
export PATH=$msBuild:$PATH
CheckExitCode MSBuild.exe $slnFile //t:Clean //m
msBuildPath=`$vswhere -latest -products \* -requires Microsoft.Component.MSBuild -find MSBuild\\\\\*\*\\\\Bin\\\\MSBuild.exe`
msBuildPath=${msBuildPath/C:\\/\/c\/}
msBuildPath=${msBuildPath//\\/\/}
msBuildDir=$(dirname "$msBuildPath")
echo $msBuildPath
export PATH=$msBuildDir:$PATH
CheckExitCode MSBuild.exe $slnFile //p:Configuration=Release //p:Platform=x86 //t:Clean //m
$nuget restore $slnFile
CheckExitCode MSBuild.exe $slnFile //p:Configuration=Release //p:Platform=x86 //t:Build //m //p:AllowedReferenceRelatedFileExtensions=.pdb
}
@@ -72,16 +83,19 @@ BuildWithMSBuild()
BuildWithXbuild()
{
export MONO_IOMAP=case
CheckExitCode xbuild /t:Clean $slnFile
CheckExitCode msbuild /p:Configuration=Debug /t:Clean $slnFile
CheckExitCode msbuild /p:Configuration=Release /t:Clean $slnFile
mono $nuget locals all -clear
mono $nuget restore $slnFile
CheckExitCode xbuild /p:Configuration=Release /p:Platform=x86 /t:Build /p:AllowedReferenceRelatedFileExtensions=.pdb $slnFile
CheckExitCode msbuild /p:Configuration=Release /p:Platform=x86 /t:Build /p:AllowedReferenceRelatedFileExtensions=.pdb $slnFile
}
Build()
{
echo "##teamcity[progressStart 'Build']"
ProgressStart 'Build'
rm -rf $outputFolder
rm -rf $testPackageFolder
if [ $runtime = "dotnet" ] ; then
BuildWithMSBuild
@@ -91,157 +105,179 @@ Build()
CleanFolder $outputFolder false
AddJsonNet
echo "Removing Mono.Posix.dll"
rm $outputFolder/Mono.Posix.dll
echo "##teamcity[progressFinish 'Build']"
echo "Adding LICENSE.md"
cp LICENSE.md $outputFolder
ProgressEnd 'Build'
}
RunGulp()
{
echo "##teamcity[progressStart 'npm install']"
ProgressStart 'npm install'
npm-cache install npm || CheckExitCode npm install
echo "##teamcity[progressFinish 'npm install']"
ProgressEnd 'npm install'
echo "##teamcity[progressStart 'Running gulp']"
ProgressStart 'Running gulp'
CheckExitCode npm run build
echo "##teamcity[progressFinish 'Running gulp']"
}
CreateMdbs()
{
local path=$1
if [ $runtime = "dotnet" ] ; then
local pdbFiles=( $(find $path -name "*.pdb") )
for filename in "${pdbFiles[@]}"
do
if [ -e ${filename%.pdb}.dll ] ; then
tools/pdb2mdb/pdb2mdb.exe ${filename%.pdb}.dll
fi
if [ -e ${filename%.pdb}.exe ] ; then
tools/pdb2mdb/pdb2mdb.exe ${filename%.pdb}.exe
fi
done
fi
ProgressEnd 'Running gulp'
}
PackageMono()
{
echo "##teamcity[progressStart 'Creating Mono Package']"
rm -rf $outputFolderMono
cp -r $outputFolder $outputFolderMono
ProgressStart 'Creating Mono Package'
echo "Creating MDBs"
CreateMdbs $outputFolderMono
rm -rf $outputFolderLinux
echo "Removing PDBs"
find $outputFolderMono -name "*.pdb" -exec rm "{}" \;
echo "Copying Binaries"
cp -r $outputFolder $outputFolderLinux
echo "Removing Service helpers"
rm -f $outputFolderMono/ServiceUninstall.*
rm -f $outputFolderMono/ServiceInstall.*
rm -f $outputFolderLinux/ServiceUninstall.*
rm -f $outputFolderLinux/ServiceInstall.*
echo "Removing native windows binaries Sqlite, MediaInfo"
rm -f $outputFolderMono/sqlite3.*
rm -f $outputFolderMono/MediaInfo.*
rm -f $outputFolderLinux/sqlite3.*
rm -f $outputFolderLinux/MediaInfo.*
echo "Adding NzbDrone.Core.dll.config (for dllmap)"
cp $sourceFolder/NzbDrone.Core/NzbDrone.Core.dll.config $outputFolderMono
cp $sourceFolder/NzbDrone.Core/NzbDrone.Core.dll.config $outputFolderLinux
echo "Adding CurlSharp.dll.config (for dllmap)"
cp $sourceFolder/NzbDrone.Common/CurlSharp.dll.config $outputFolderMono
echo "Renaming NzbDrone.Console.exe to NzbDrone.exe"
rm $outputFolderMono/Radarr.exe*
for file in $outputFolderMono/Radarr.Console.exe*; do
echo "Renaming Radarr.Console.exe to Radarr.exe"
rm $outputFolderLinux/Radarr.exe*
for file in $outputFolderLinux/Radarr.Console.exe*; do
mv "$file" "${file//.Console/}"
done
echo "Removing NzbDrone.Windows"
rm $outputFolderMono/NzbDrone.Windows.*
rm $outputFolderLinux/NzbDrone.Windows.*
echo "Adding NzbDrone.Mono to UpdatePackage"
cp $outputFolderMono/NzbDrone.Mono.* $updateFolderMono
cp $outputFolderLinux/NzbDrone.Mono.* $updateFolderMono
echo "##teamcity[progressFinish 'Creating Mono Package']"
ProgressEnd 'Creating Mono Package'
}
PackageOsx()
PackageMacOS()
{
echo "##teamcity[progressStart 'Creating OS X Package']"
rm -rf $outputFolderOsx
cp -r $outputFolderMono $outputFolderOsx
ProgressStart 'Creating MacOS Package'
echo "Adding sqlite dylibs"
cp $sourceFolder/Libraries/Sqlite/*.dylib $outputFolderOsx
echo "Adding MediaInfo dylib"
cp $sourceFolder/Libraries/MediaInfo/*.dylib $outputFolderOsx
rm -rf $outputFolderMacOS
mkdir $outputFolderMacOS
echo "Adding Startup script"
cp ./osx/Radarr $outputFolderOsx
cp ./macOS/Radarr $outputFolderMacOS
echo "##teamcity[progressFinish 'Creating OS X Package']"
echo "Copying Binaries"
cp -r $outputFolderLinux/* $outputFolderMacOS
echo "Adding sqlite dylibs"
cp $sourceFolder/Libraries/Sqlite/*.dylib $outputFolderMacOS
echo "Adding MediaInfo dylib"
cp $sourceFolder/Libraries/MediaInfo/*.dylib $outputFolderMacOS
ProgressEnd 'Creating MacOS Package'
}
PackageOsxApp()
PackageMacOSApp()
{
echo "##teamcity[progressStart 'Creating OS X App Package']"
rm -rf $outputFolderOsxApp
mkdir $outputFolderOsxApp
ProgressStart 'Creating macOS App Package'
cp -r ./osx/Radarr.app $outputFolderOsxApp
cp -r $outputFolderOsx $outputFolderOsxApp/Radarr.app/Contents/MacOS
rm -rf $outputFolderMacOSApp
mkdir $outputFolderMacOSApp
cp -r ./macOS/Radarr.app $outputFolderMacOSApp
mkdir -p $outputFolderMacOSApp/Radarr.app/Contents/MacOS
echo "##teamcity[progressFinish 'Creating OS X App Package']"
echo "Adding Startup script"
cp ./macOS/Radarr $outputFolderMacOSApp/Radarr.app/Contents/MacOS
echo "Copying Binaries"
cp -r $outputFolderLinux/* $outputFolderMacOSApp/Radarr.app/Contents/MacOS
echo "Adding sqlite dylibs"
cp $sourceFolder/Libraries/Sqlite/*.dylib $outputFolderMacOSApp/Radarr.app/Contents/MacOS
echo "Adding MediaInfo dylib"
cp $sourceFolder/Libraries/MediaInfo/*.dylib $outputFolderMacOSApp/Radarr.app/Contents/MacOS
echo "Removing Update Folder"
rm -r $outputFolderMacOSApp/Radarr.app/Contents/MacOS/NzbDrone.Update
ProgressEnd 'Creating macOS App Package'
}
PackageTests()
{
echo "Packaging Tests"
echo "##teamcity[progressStart 'Creating Test Package']"
ProgressStart 'Creating Test Package'
rm -rf $testPackageFolder
mkdir $testPackageFolder
find $sourceFolder -path $testSearchPattern -exec cp -r -u -T "{}" $testPackageFolder \;
find . -maxdepth 6 -path $testSearchPattern -exec cp -r "{}" $testPackageFolder \;
if [ $runtime = "dotnet" ] ; then
$nuget install NUnit.Runners -Version 3.2.1 -Output $testPackageFolder
$nuget install NUnit.ConsoleRunner -Version 3.10.0 -Output $testPackageFolder
else
mono $nuget install NUnit.Runners -Version 3.2.1 -Output $testPackageFolder
mono $nuget install NUnit.ConsoleRunner -Version 3.10.0 -Output $testPackageFolder
fi
cp $outputFolder/*.dll $testPackageFolder
cp ./*.sh $testPackageFolder
echo "Creating MDBs for tests"
CreateMdbs $testPackageFolder
cp $outputFolder/*.exe $testPackageFolder
cp ./test.sh $testPackageFolder
rm -f $testPackageFolder/*.log.config
CleanFolder $testPackageFolder true
echo "Adding NzbDrone.Core.dll.config (for dllmap)"
cp $sourceFolder/NzbDrone.Core/NzbDrone.Core.dll.config $testPackageFolder
echo "Adding CurlSharp.dll.config (for dllmap)"
cp $sourceFolder/NzbDrone.Common/CurlSharp.dll.config $testPackageFolder
echo "Copying CurlSharp libraries"
cp $sourceFolder/ExternalModules/CurlSharp/libs/i386/* $testPackageFolder
echo "##teamcity[progressFinish 'Creating Test Package']"
echo "Adding sqlite and mediainfo dylibs"
cp $sourceFolder/Libraries/MediaInfo/*.dylib $testPackageFolder
cp $sourceFolder/Libraries/Sqlite/*.dylib $testPackageFolder
ProgressEnd 'Creating Test Package'
}
CleanupWindowsPackage()
{
ProgressStart 'Cleaning Windows Package'
echo "Removing NzbDrone.Mono"
rm -f $outputFolder/NzbDrone.Mono.*
echo "Adding NzbDrone.Windows to UpdatePackage"
cp $outputFolder/NzbDrone.Windows.* $updateFolder
ProgressEnd 'Cleaning Windows Package'
}
PackageArtifacts()
{
echo "Creating Artifact Directories"
rm -rf $artifactsFolder
mkdir $artifactsFolder
mkdir $artifactsFolderWindows
mkdir $artifactsFolderMacOS
mkdir $artifactsFolderLinux
mkdir $artifactsFolderWindows/Radarr
mkdir $artifactsFolderMacOS/Radarr
mkdir $artifactsFolderLinux/Radarr
mkdir $artifactsFolderMacOSApp
cp -r $outputFolder/* $artifactsFolderWindows/Radarr
cp -r $outputFolderMacOSApp/* $artifactsFolderMacOSApp
cp -r $outputFolderMacOS/* $artifactsFolderMacOS/Radarr
cp -r $outputFolderLinux/* $artifactsFolderLinux/Radarr
}
# Use mono or .net depending on OS
@@ -256,10 +292,51 @@ case "$(uname -s)" in
;;
esac
Build
RunGulp
PackageMono
PackageOsx
PackageOsxApp
PackageTests
CleanupWindowsPackage
POSITIONAL=()
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
--only-backend)
ONLY_BACKEND=YES
shift # past argument
;;
--only-frontend)
ONLY_FRONTEND=YES
shift # past argument
;;
--only-packages)
ONLY_PACKAGES=YES
shift # past argument
;;
*) # unknown option
POSITIONAL+=("$1") # save it in an array for later
shift # past argument
;;
esac
done
set -- "${POSITIONAL[@]}" # restore positional parameters
# Only build backend if we haven't set only-frontend or only-packages
if [ -z "$ONLY_FRONTEND" ] && [ -z "$ONLY_PACKAGES" ];
then
Build
PackageTests
fi
# Only build frontend if we haven't set only-backend or only-packages
if [ -z "$ONLY_BACKEND" ] && [ -z "$ONLY_PACKAGES" ];
then
RunGulp
fi
# Only package if we haven't set only-backend or only-frontend
if [ -z "$ONLY_BACKEND" ] && [ -z "$ONLY_FRONTEND" ];
then
PackageMono
PackageMacOS
PackageMacOSApp
CleanupWindowsPackage
PackageArtifacts
fi

View File

@@ -1,15 +0,0 @@
# Changelog
{{#versions}}
## {{{label}}}
{{#sections}}
### {{{label}}}
{{#commits}}
- {{{subject}}} [{{{author}}}]
{{/commits}}
{{/sections}}
{{/versions}}

View File

@@ -1,44 +0,0 @@
input1 = """Prometheus.Special.Edition.Fan Edit.2012..BRRip.x264.AAC-m2g
Star Wars Episode IV - A New Hope (Despecialized) 1999.mkv
Prometheus.(Special.Edition.Remastered).2012.[Bluray-1080p].mkv
Prometheus Extended 2012
Prometheus Extended Directors Cut Fan Edit 2012
Prometheus Director's Cut 2012
Prometheus Directors Cut 2012
Prometheus.(Extended.Theatrical.Version.IMAX).BluRay.1080p.2012.asdf
2001 A Space Odyssey Director's Cut (1968).mkv
2001: A Space Odyssey (Extended Directors Cut FanEdit) Bluray 1080p 1968
A Fake Movie 2035 Directors 2012.mkv
Blade Runner Director's Cut 2049.mkv
Prometheus 50th Anniversary Edition 2012.mkv
Movie 2in1 2012.mkv
Movie IMAX 2012.mkv"""
output1 = """Special.Edition.Fan Edit BRRip.x264.AAC-m2g
Despecialized mkv
Special.Edition.Remastered Bluray-1080p].mkv
Extended mkv
Extended Directors Cut Fan Edit mkv
Director's Cut mkv
Directors Cut mkv
Extended.Theatrical.Version.IMAX asdf
Director's Cut mkv
Extended Directors Cut FanEdit mkv
Directors mkv
Director's Cut mkv
50th Anniversary Edition mkv
2in1 mkv
IMAX mkv"""
inputs = input1.split("\n")
outputs = output1.split("\n")
real_o = []
for output in outputs:
real_o.append(output.split(" ")[0].replace(".", " ").strip())
count = 0
for inp in inputs:
o = real_o[count]
print "[TestCase(\"{0}\", \"{1}\")]".format(inp, o)
count += 1

48
debian/copyright vendored
View File

@@ -1,24 +1,24 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: nzbdrone
Source: https://github.com/Sonarr/Sonarr
Files: *
Copyright: 2010-2016 Sonarr <hello@sonarr.tv>
License: GPL-3.0+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
.
On Debian systems, the complete text of the GNU General
Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: nzbdrone
Source: https://github.com/Sonarr/Sonarr
Files: *
Copyright: 2010-2016 Sonarr <hello@sonarr.tv>
License: GPL-3.0+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
.
On Debian systems, the complete text of the GNU General
Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".

2
debian/install vendored
View File

@@ -1 +1 @@
nzbdrone_bin/* opt/NzbDrone
nzbdrone_bin/* opt/NzbDrone

0
debian/rules vendored Executable file → Normal file
View File

View File

@@ -9,7 +9,11 @@ APPNAME="Radarr"
#set up environment
if [[ -x '/opt/local/bin/mono' ]]; then
# Macports and mono-supplied installer path
export PATH="/opt/local/bin:$PATH"
elif [[ -x '/usr/local/bin/mono' ]]; then
# Homebrew-supplied path to mono
export PATH="/usr/local/bin:$PATH"
fi
export DYLD_FALLBACK_LIBRARY_PATH="$DIR"

View File

@@ -19,7 +19,7 @@
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Sonarr</string>
<string>Radarr</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>

6707
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "Radarr",
"version": "2.0.0",
"name": "radarr",
"version": "1.0.0",
"description": "Radarr",
"main": "main.js",
"scripts": {
@@ -38,11 +38,13 @@
"handlebars": "3.0.3",
"jshint-loader": "0.8.3",
"jshint-stylish": "2.0.1",
"npm": "^6.0.1",
"run-sequence": "1.1.1",
"streamqueue": "1.1.0",
"tar.gz": "0.1.1",
"url-search-params": "^0.6.1",
"webpack": "1.12.0",
"webpack-stream": "2.1.0"
"webpack-stream": "2.1.0",
"natives": "^1.1.3"
}
}

View File

@@ -1,77 +0,0 @@
if [ $# -eq 0 ]; then
if [ "$TRAVIS_PULL_REQUEST" != false ]; then
echo "Need to supply version argument" && exit;
fi
fi
# Use mono or .net depending on OS
case "$(uname -s)" in
CYGWIN*|MINGW32*|MINGW64*|MSYS*)
# on windows, use dotnet
runtime="dotnet"
;;
*)
# otherwise use mono
runtime="mono"
;;
esac
if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
VERSION="$(date +%H:%M:%S)"
YEAR="$(date +%Y)"
MONTH="$(date +%m)"
DAY="$(date +%d)"
else
VERSION=$1
BRANCH=$2
BRANCH=${BRANCH#refs\/heads\/}
BRANCH=${BRANCH//\//-}
fi
outputFolder='./_output'
outputFolderMono='./_output_mono'
outputFolderOsx='./_output_osx'
outputFolderOsxApp='./_output_osx_app'
tr -d "\r" < $outputFolderOsxApp/Radarr.app/Contents/MacOS/Radarr > $outputFolderOsxApp/Radarr.app/Contents/MacOS/Radarr2
rm $outputFolderOsxApp/Radarr.app/Contents/MacOS/Radarr
chmod +x $outputFolderOsxApp/Radarr.app/Contents/MacOS/Radarr2
mv $outputFolderOsxApp/Radarr.app/Contents/MacOS/Radarr2 $outputFolderOsxApp/Radarr.app/Contents/MacOS/Radarr >& error.log
if [ $runtime = "dotnet" ] ; then
./7za.exe a Radarr_Windows_$VERSION.zip ./Radarr_Windows_$VERSION/*
./7za.exe a -ttar -so Radarr_Mono_$VERSION.tar ./Radarr_Mono_$VERSION/* | ./7za.exe a -si Radarr_Mono_$VERSION.tar.gz
./7za.exe a -ttar -so Radarr_OSX_$VERSION.tar ./_output_osx/* | ./7za.exe a -si Radarr_OSX_$VERSION.tar.gz
./7za.exe a -ttar -so Radarr_OSX_App_$VERSION.tar ./_output_osx_app/* | ./7za.exe a -si Radarr_OSX_App_$VERSION.tar.gz
else
cp -r $outputFolder/ Radarr
zip -r Radarr.$BRANCH.$VERSION.windows.zip Radarr
rm -rf Radarr
cp -r $outputFolderMono/ Radarr
tar -zcvf Radarr.$BRANCH.$VERSION.linux.tar.gz Radarr
rm -rf Radarr
cp -r $outputFolderOsx/ Radarr
tar -zcvf Radarr.$BRANCH.$VERSION.osx.tar.gz Radarr
rm -rf Radarr
#TODO update for tar.gz
cd _output_osx_app/
zip -r ../Radarr.$BRANCH.$VERSION.osx-app.zip *
fi
# ftp -n ftp.leonardogalli.ch << END_SCRIPT
# passive
# quote USER $FTP_USER
# quote PASS $FTP_PASS
# mkdir builds
# cd builds
# mkdir $YEAR
# cd $YEAR
# mkdir $MONTH
# cd $MONTH
# mkdir $DAY
# cd $DAY
# binary
# put Radarr_Windows_$VERSION.zip
# put Radarr_Mono_$VERSION.zip
# put Radarr_OSX_$VERSION.zip
# quit
# END_SCRIPT

View File

@@ -1,60 +0,0 @@
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define AppName "Radarr"
#define AppPublisher "Team Radarr"
#define AppURL "https://radarr.video/"
#define ForumsURL "https://github.com/Radarr/Radarr/issues"
#define AppExeName "Radarr.exe"
#define BuildNumber "2.0"
#define BuildVersion GetEnv('APPVEYOR_BUILD_VERSION')
#define BranchName GetEnv('APPVEYOR_REPO_BRANCH')
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{56C1065D-3523-4025-B76D-6F73F67F7F82}
AppName={#AppName}
AppVersion=0.2
AppPublisher={#AppPublisher}
AppPublisherURL={#AppURL}
AppSupportURL={#ForumsURL}
AppUpdatesURL={#AppURL}
DefaultDirName={commonappdata}\Radarr\bin
DisableDirPage=yes
DefaultGroupName={#AppName}
DisableProgramGroupPage=yes
OutputBaseFilename=Radarr.{#BranchName}.{#BuildVersion}.installer
SolidCompression=yes
AppCopyright=Creative Commons 3.0 License
AllowUNCPath=False
UninstallDisplayIcon={app}\Radarr.exe
DisableReadyPage=True
CompressionThreads=2
Compression=lzma2/normal
AppContact={#ForumsURL}
VersionInfoVersion={#BuildNumber}
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Tasks]
;Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Name: "windowsService"; Description: "Install as a Windows Service"
[Files]
Source: "..\_output\Radarr.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\_output\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{group}\{#AppName}"; Filename: "{app}\{#AppExeName}"; Parameters: "/icon"
Name: "{commondesktop}\{#AppName}"; Filename: "{app}\{#AppExeName}"; Parameters: "/icon"
[Run]
Filename: "{app}\radarr.console.exe"; Parameters: "/u"; Flags: waituntilterminated;
Filename: "{app}\radarr.console.exe"; Parameters: "/i"; Flags: waituntilterminated; Tasks: windowsService
[UninstallRun]
Filename: "{app}\radarr.console.exe"; Parameters: "/u"; Flags: waituntilterminated skipifdoesntexist

75
setup/radarr.iss Normal file
View File

@@ -0,0 +1,75 @@
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define AppName "Radarr"
#define AppPublisher "Team Radarr"
#define AppURL "https://radarr.video/"
#define ForumsURL "https://forums.radarr.video/"
#define AppExeName "Radarr.exe"
#define BaseVersion "0.2.0"
#define BuildNumber GetEnv('MINORVERSION')
#define BuildVersion GetEnv('RADARRVERSION')
#define BranchName GetEnv('BUILD_SOURCEBRANCHNAME')
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{56C1065D-3523-4025-B76D-6F73F67F7F82}
AppName={#AppName}
AppVersion={#BaseVersion}
AppPublisher={#AppPublisher}
AppPublisherURL={#AppURL}
AppSupportURL={#ForumsURL}
AppUpdatesURL={#AppURL}
DefaultDirName={commonappdata}\Radarr\bin
DisableDirPage=yes
DefaultGroupName={#AppName}
DisableProgramGroupPage=yes
OutputBaseFilename=Radarr.{#BranchName}.{#BuildVersion}.windows
SolidCompression=yes
AppCopyright=Creative Commons 3.0 License
AllowUNCPath=False
UninstallDisplayIcon={app}\Radarr.exe
DisableReadyPage=True
CompressionThreads=2
Compression=lzma2/normal
AppContact={#ForumsURL}
VersionInfoVersion={#BaseVersion}.{#BuildNumber}
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"
Name: "windowsService"; Description: "Install Windows Service (Starts when the computer starts)"; GroupDescription: "Start automatically"; Flags: exclusive
Name: "startupShortcut"; Description: "Create shortcut in Startup folder (Starts when you log into Windows)"; GroupDescription: "Start automatically"; Flags: exclusive unchecked
Name: "none"; Description: "Do not start automatically"; GroupDescription: "Start automatically"; Flags: exclusive unchecked
[Files]
Source: "..\_output\Radarr.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\_output\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{group}\{#AppName}"; Filename: "{app}\{#AppExeName}"; Parameters: "/icon"
Name: "{commondesktop}\{#AppName}"; Filename: "{app}\{#AppExeName}"; Parameters: "/icon"
Name: "{userstartup}\{#AppName}"; Filename: "{app}\Radarr.exe"; WorkingDir: "{app}"; Tasks: startupShortcut
[Run]
Filename: "{app}\Radarr.Console.exe"; StatusMsg: "Removing previous Windows Service"; Parameters: "/u"; Flags: runhidden waituntilterminated;
Filename: "{app}\Radarr.Console.exe"; Description: "Enable Access from Other Devices"; StatusMsg: "Enabling Remote access"; Parameters: "/registerurl"; Flags: postinstall runascurrentuser runhidden waituntilterminated; Tasks: startupShortcut none;
Filename: "{app}\Radarr.Console.exe"; StatusMsg: "Installing Windows Service"; Parameters: "/i"; Flags: runhidden waituntilterminated; Tasks: windowsService
Filename: "{app}\Radarr.exe"; Description: "Open Radarr Web UI"; Flags: postinstall skipifsilent nowait; Tasks: windowsService;
Filename: "{app}\Radarr.exe"; Description: "Start Radarr"; Flags: postinstall skipifsilent nowait; Tasks: startupShortcut none;
[UninstallRun]
Filename: "{app}\radarr.console.exe"; Parameters: "/u"; Flags: waituntilterminated skipifdoesntexist
[Code]
function PrepareToInstall(var NeedsRestart: Boolean): String;
var
ResultCode: Integer;
begin
Exec(ExpandConstant('{commonappdata}\Radarr\bin\Radarr.Console.exe'), '/u', '', 0, ewWaitUntilTerminated, ResultCode)
end;

Binary file not shown.

View File

@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RiderRiderContentModelStore">
<excludedPaths />
</component>
</project>

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" addBOMForNewFiles="with NO BOM" />
</project>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ContentModelUserStore">
<attachedFolders />
<explicitIncludes />
<explicitExcludes />
</component>
</project>

6
src/.idea/.idea.NzbDrone/.idea/misc.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="com.jetbrains.rider.android.RiderAndroidMiscFileCreationComponent">
<option name="ENSURE_MISC_FILE_EXISTS" value="true" />
</component>
</project>

View File

@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/.idea.NzbDrone/riderModule.iml" filepath="$PROJECT_DIR$/.idea/.idea.NzbDrone/riderModule.iml" />
</modules>
</component>
</project>

7
src/.idea/.idea.NzbDrone/.idea/vcs.xml generated Normal file
View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
<mapping directory="$PROJECT_DIR$/ExternalModules/CurlSharp" vcs="Git" />
</component>
</project>

View File

@@ -1,103 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="RIDER_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$/../../../Logo/1024.png">
<sourceFolder url="file://$MODULE_DIR$/../../../Logo/1024.png" isTestSource="false" />
</content>
<content url="file://$MODULE_DIR$/../../../Logo/64.png">
<sourceFolder url="file://$MODULE_DIR$/../../../Logo/64.png" isTestSource="false" />
</content>
<content url="file://$MODULE_DIR$/../..">
<sourceFolder url="file://$MODULE_DIR$/../../.nuget/NuGet.exe" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../../Common/CommonAssemblyInfo.cs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../../Common/CommonVersionInfo.cs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../../Common/GlobalSuppressions.cs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../../ExternalModules/CurlSharp/CurlSharp" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../../Libraries/MediaInfo/libmediainfo.0.dylib" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../../Libraries/MediaInfo/MediaInfo.dll" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../../Libraries/Sqlite/libsqlite3.0.dylib" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../../Libraries/Sqlite/sqlite3.dll" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../../LogentriesCore" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../../LogentriesNLog" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../../Marr.Data" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../../Microsoft.AspNet.SignalR.Core" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../../Microsoft.AspNet.SignalR.Owin" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../../MonoTorrent" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../../NzbDrone" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../../NzbDrone.Api" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../../NzbDrone.Api.Test" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../../NzbDrone.App.Test" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../../NzbDrone.Automation.Test" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../../NzbDrone.Common" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../../NzbDrone.Common.Test" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../../NzbDrone.Console" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../../NzbDrone.Core" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../../NzbDrone.Core.Test" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../../NzbDrone.Host" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../../NzbDrone.Integration.Test" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../../NzbDrone.Libraries.Test" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../../NzbDrone.Mono" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../../NzbDrone.Mono.Test" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../../NzbDrone.SignalR" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../../NzbDrone.Test.Common" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../../NzbDrone.Test.Dummy" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../../NzbDrone.Update" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../../NzbDrone.Update.Test" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../../NzbDrone.Windows" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../../NzbDrone.Windows.Test" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../../ServiceHelpers/ServiceInstall" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../../ServiceHelpers/ServiceUninstall" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/../../ExternalModules/CurlSharp/CurlSharp/bin" />
<excludeFolder url="file://$MODULE_DIR$/../../ExternalModules/CurlSharp/CurlSharp/obj" />
<excludeFolder url="file://$MODULE_DIR$/../../LogentriesCore/bin" />
<excludeFolder url="file://$MODULE_DIR$/../../LogentriesCore/obj" />
<excludeFolder url="file://$MODULE_DIR$/../../LogentriesNLog/bin" />
<excludeFolder url="file://$MODULE_DIR$/../../LogentriesNLog/obj" />
<excludeFolder url="file://$MODULE_DIR$/../../Marr.Data/obj" />
<excludeFolder url="file://$MODULE_DIR$/../../Microsoft.AspNet.SignalR.Core/bin" />
<excludeFolder url="file://$MODULE_DIR$/../../Microsoft.AspNet.SignalR.Core/obj" />
<excludeFolder url="file://$MODULE_DIR$/../../Microsoft.AspNet.SignalR.Owin/bin" />
<excludeFolder url="file://$MODULE_DIR$/../../Microsoft.AspNet.SignalR.Owin/obj" />
<excludeFolder url="file://$MODULE_DIR$/../../MonoTorrent/obj" />
<excludeFolder url="file://$MODULE_DIR$/../../NzbDrone.Api.Test/bin" />
<excludeFolder url="file://$MODULE_DIR$/../../NzbDrone.Api.Test/obj" />
<excludeFolder url="file://$MODULE_DIR$/../../NzbDrone.Api/obj" />
<excludeFolder url="file://$MODULE_DIR$/../../NzbDrone.App.Test/bin" />
<excludeFolder url="file://$MODULE_DIR$/../../NzbDrone.App.Test/obj" />
<excludeFolder url="file://$MODULE_DIR$/../../NzbDrone.Automation.Test/bin" />
<excludeFolder url="file://$MODULE_DIR$/../../NzbDrone.Automation.Test/obj" />
<excludeFolder url="file://$MODULE_DIR$/../../NzbDrone.Common.Test/bin" />
<excludeFolder url="file://$MODULE_DIR$/../../NzbDrone.Common.Test/obj" />
<excludeFolder url="file://$MODULE_DIR$/../../NzbDrone.Common/obj" />
<excludeFolder url="file://$MODULE_DIR$/../../NzbDrone.Console/obj" />
<excludeFolder url="file://$MODULE_DIR$/../../NzbDrone.Core.Test/bin" />
<excludeFolder url="file://$MODULE_DIR$/../../NzbDrone.Core.Test/obj" />
<excludeFolder url="file://$MODULE_DIR$/../../NzbDrone.Core/obj" />
<excludeFolder url="file://$MODULE_DIR$/../../NzbDrone.Host/obj" />
<excludeFolder url="file://$MODULE_DIR$/../../NzbDrone.Integration.Test/bin" />
<excludeFolder url="file://$MODULE_DIR$/../../NzbDrone.Integration.Test/obj" />
<excludeFolder url="file://$MODULE_DIR$/../../NzbDrone.Libraries.Test/bin" />
<excludeFolder url="file://$MODULE_DIR$/../../NzbDrone.Libraries.Test/obj" />
<excludeFolder url="file://$MODULE_DIR$/../../NzbDrone.Mono.Test/bin" />
<excludeFolder url="file://$MODULE_DIR$/../../NzbDrone.Mono.Test/obj" />
<excludeFolder url="file://$MODULE_DIR$/../../NzbDrone.Mono/obj" />
<excludeFolder url="file://$MODULE_DIR$/../../NzbDrone.SignalR/obj" />
<excludeFolder url="file://$MODULE_DIR$/../../NzbDrone.Test.Common/bin" />
<excludeFolder url="file://$MODULE_DIR$/../../NzbDrone.Test.Common/obj" />
<excludeFolder url="file://$MODULE_DIR$/../../NzbDrone.Test.Dummy/bin" />
<excludeFolder url="file://$MODULE_DIR$/../../NzbDrone.Test.Dummy/obj" />
<excludeFolder url="file://$MODULE_DIR$/../../NzbDrone.Update.Test/bin" />
<excludeFolder url="file://$MODULE_DIR$/../../NzbDrone.Update.Test/obj" />
<excludeFolder url="file://$MODULE_DIR$/../../NzbDrone.Update/obj" />
<excludeFolder url="file://$MODULE_DIR$/../../NzbDrone.Windows.Test/bin" />
<excludeFolder url="file://$MODULE_DIR$/../../NzbDrone.Windows.Test/obj" />
<excludeFolder url="file://$MODULE_DIR$/../../NzbDrone.Windows/obj" />
<excludeFolder url="file://$MODULE_DIR$/../../NzbDrone/obj" />
<excludeFolder url="file://$MODULE_DIR$/../../ServiceHelpers/ServiceInstall/obj" />
<excludeFolder url="file://$MODULE_DIR$/../../ServiceHelpers/ServiceUninstall/obj" />
<excludeFolder url="file://$MODULE_DIR$/../../_ReSharper.Caches/ReSharperHost8.NzbDrone.00" />
<excludeFolder url="file://$MODULE_DIR$/../../packages" />
</content>
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@@ -2,4 +2,4 @@
using System.Reflection;
[assembly: AssemblyVersion("0.1.0.*")]
[assembly: AssemblyVersion("10.0.0.*")]

Binary file not shown.

View File

@@ -1,648 +0,0 @@
using System;
using System.Collections.Concurrent;
using System.Configuration;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Security;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
namespace LogentriesCore
{
public class AsyncLogger
{
#region Constants
// Current version number.
protected const String Version = "2.6.0";
// Size of the internal event queue.
protected const int QueueSize = 32768;
// Minimal delay between attempts to reconnect in milliseconds.
protected const int MinDelay = 100;
// Maximal delay between attempts to reconnect in milliseconds.
protected const int MaxDelay = 10000;
// Appender signature - used for debugging messages.
protected const String LeSignature = "LE: ";
// Legacy Logentries configuration names.
protected const String LegacyConfigTokenName = "LOGENTRIES_TOKEN";
protected const String LegacyConfigAccountKeyName = "LOGENTRIES_ACCOUNT_KEY";
protected const String LegacyConfigLocationName = "LOGENTRIES_LOCATION";
// New Logentries configuration names.
protected const String ConfigTokenName = "Logentries.Token";
protected const String ConfigAccountKeyName = "Logentries.AccountKey";
protected const String ConfigLocationName = "Logentries.Location";
// Error message displayed when invalid token is detected.
protected const String InvalidTokenMessage = "\n\nIt appears your LOGENTRIES_TOKEN value is invalid or missing.\n\n";
// Error message displayed when invalid account_key or location parameters are detected.
protected const String InvalidHttpPutCredentialsMessage = "\n\nIt appears your LOGENTRIES_ACCOUNT_KEY or LOGENTRIES_LOCATION values are invalid or missing.\n\n";
// Error message deisplayed when queue overflow occurs.
protected const String QueueOverflowMessage = "\n\nLogentries buffer queue overflow. Message dropped.\n\n";
// Newline char to trim from message for formatting.
protected static char[] TrimChars = { '\r', '\n' };
/** Non-Unix and Unix Newline */
protected static string[] posix_newline = { "\r\n", "\n" };
/** Unicode line separator character */
protected static string line_separator = "\u2028";
// Restricted symbols that should not appear in host name.
// See http://support.microsoft.com/kb/228275/en-us for details.
private static Regex ForbiddenHostNameChars = new Regex(@"[/\\\[\]\""\:\;\|\<\>\+\=\,\?\* _]{1,}", RegexOptions.Compiled);
/** Regex used to validate GUID in .NET3.5 */
private static Regex isGuid = new Regex(@"^(\{){0,1}[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}(\}){0,1}$", RegexOptions.Compiled);
#endregion
#region Singletons
// UTF-8 output character set.
protected static readonly UTF8Encoding UTF8 = new UTF8Encoding();
// ASCII character set used by HTTP.
protected static readonly ASCIIEncoding ASCII = new ASCIIEncoding();
//static list of all the queues the le appender might be managing.
private static ConcurrentBag<BlockingCollection<string>> _allQueues = new ConcurrentBag<BlockingCollection<string>>();
/// <summary>
/// Determines if the queue is empty after waiting the specified waitTime.
/// Returns true or false if the underlying queues are empty.
/// </summary>
/// <param name="waitTime">The length of time the method should block before giving up waiting for it to empty.</param>
/// <returns>True if the queue is empty, false if there are still items waiting to be written.</returns>
public static bool AreAllQueuesEmpty(TimeSpan waitTime)
{
var start = DateTime.UtcNow;
var then = DateTime.UtcNow;
while (start.Add(waitTime) > then)
{
if (_allQueues.All(x => x.Count == 0))
return true;
Thread.Sleep(100);
then = DateTime.UtcNow;
}
return _allQueues.All(x => x.Count == 0);
}
#endregion
public AsyncLogger()
{
Queue = new BlockingCollection<string>(QueueSize);
_allQueues.Add(Queue);
WorkerThread = new Thread(Run);
WorkerThread.Name = "Logentries Log4net Appender";
WorkerThread.IsBackground = true;
}
#region Configuration properties
private String m_Token = "";
private String m_AccountKey = "";
private String m_Location = "";
private bool m_ImmediateFlush = false;
private bool m_Debug = false;
private bool m_UseHttpPut = false;
private bool m_UseSsl = false;
// Properties for defining location of DataHub instance if one is used.
private bool m_UseDataHub = false; // By default Logentries service is used instead of DataHub instance.
private String m_DataHubAddr = "";
private int m_DataHubPort = 0;
// Properties to define host name of user's machine and define user-specified log ID.
private bool m_UseHostName = false; // Defines whether to prefix log message with HostName or not.
private String m_HostName = ""; // User-defined or auto-defined host name (if not set in config. file)
private String m_LogID = ""; // User-defined log ID to be prefixed to the log message.
// Sets DataHub usage flag.
public void setIsUsingDataHub(bool useDataHub)
{
m_UseDataHub = useDataHub;
}
public bool getIsUsingDataHab()
{
return m_UseDataHub;
}
// Sets DataHub instance address.
public void setDataHubAddr(String dataHubAddr)
{
m_DataHubAddr = dataHubAddr;
}
public String getDataHubAddr()
{
return m_DataHubAddr;
}
// Sets the port on which DataHub instance is waiting for log messages.
public void setDataHubPort(int port)
{
m_DataHubPort = port;
}
public int getDataHubPort()
{
return m_DataHubPort;
}
public void setToken(String token)
{
m_Token = token;
}
public String getToken()
{
return m_Token;
}
public void setAccountKey(String accountKey)
{
m_AccountKey = accountKey;
}
public string getAccountKey()
{
return m_AccountKey;
}
public void setLocation(String location)
{
m_Location = location;
}
public String getLocation()
{
return m_Location;
}
public void setImmediateFlush(bool immediateFlush)
{
m_ImmediateFlush = immediateFlush;
}
public bool getImmediateFlush()
{
return m_ImmediateFlush;
}
public void setDebug(bool debug)
{
m_Debug = debug;
}
public bool getDebug()
{
return m_Debug;
}
public void setUseHttpPut(bool useHttpPut)
{
m_UseHttpPut = useHttpPut;
}
public bool getUseHttpPut()
{
return m_UseHttpPut;
}
public void setUseSsl(bool useSsl)
{
m_UseSsl = useSsl;
}
public bool getUseSsl()
{
return m_UseSsl;
}
public void setUseHostName(bool useHostName)
{
m_UseHostName = useHostName;
}
public bool getUseHostName()
{
return m_UseHostName;
}
public void setHostName(String hostName)
{
m_HostName = hostName;
}
public String getHostName()
{
return m_HostName;
}
public void setLogID(String logID)
{
m_LogID = logID;
}
public String getLogID()
{
return m_LogID;
}
#endregion
protected readonly BlockingCollection<string> Queue;
protected readonly Thread WorkerThread;
protected readonly Random Random = new Random();
private LeClient LeClient = null;
protected bool IsRunning = false;
#region Protected methods
protected virtual void Run()
{
try
{
// Open connection.
ReopenConnection();
string logMessagePrefix = String.Empty;
if (m_UseHostName)
{
// If LogHostName is set to "true", but HostName is not defined -
// try to get host name from Environment.
if (m_HostName == String.Empty)
{
try
{
WriteDebugMessages("HostName parameter is not defined - trying to get it from System.Environment.MachineName");
m_HostName = "HostName=" + System.Environment.MachineName + " ";
}
catch (InvalidOperationException)
{
// Cannot get host name automatically, so assume that HostName is not used
// and log message is sent without it.
m_UseHostName = false;
WriteDebugMessages("Failed to get HostName parameter using System.Environment.MachineName. Log messages will not be prefixed by HostName");
}
}
else
{
if (!CheckIfHostNameValid(m_HostName))
{
// If user-defined host name is incorrect - we cannot use it
// and log message is sent without it.
m_UseHostName = false;
WriteDebugMessages("HostName parameter contains prohibited characters. Log messages will not be prefixed by HostName");
}
else
{
m_HostName = "HostName=" + m_HostName + " ";
}
}
}
if (m_LogID != String.Empty)
{
logMessagePrefix = m_LogID + " ";
}
if (m_UseHostName)
{
logMessagePrefix += m_HostName;
}
// Flag that is set if logMessagePrefix is empty.
bool isPrefixEmpty = (logMessagePrefix == String.Empty);
// Send data in queue.
while (true)
{
// Take data from queue.
var line = Queue.Take();
// Replace newline chars with line separator to format multi-line events nicely.
foreach (String newline in posix_newline)
{
line = line.Replace(newline, line_separator);
}
// If m_UseDataHub == true (logs are sent to DataHub instance) then m_Token is not
// appended to the message.
string finalLine = ((!m_UseHttpPut && !m_UseDataHub) ? this.m_Token + line : line) + '\n';
// Add prefixes: LogID and HostName if they are defined.
if (!isPrefixEmpty)
{
finalLine = logMessagePrefix + finalLine;
}
byte[] data = UTF8.GetBytes(finalLine);
// Send data, reconnect if needed.
while (true)
{
try
{
this.LeClient.Write(data, 0, data.Length);
if (m_ImmediateFlush)
this.LeClient.Flush();
}
catch (IOException)
{
// Reopen the lost connection.
ReopenConnection();
continue;
}
break;
}
}
}
catch (ThreadInterruptedException ex)
{
WriteDebugMessages("Logentries asynchronous socket client was interrupted.", ex);
}
}
protected virtual void OpenConnection()
{
try
{
if (LeClient == null)
{
// Create LeClient instance providing all needed parameters. If DataHub-related properties
// have not been overridden by log4net or NLog configurators, then DataHub is not used,
// because m_UseDataHub == false by default.
LeClient = new LeClient(m_UseHttpPut, m_UseSsl, m_UseDataHub, m_DataHubAddr, m_DataHubPort);
}
LeClient.Connect();
if (m_UseHttpPut)
{
var header = String.Format("PUT /{0}/hosts/{1}/?realtime=1 HTTP/1.1\r\n\r\n", m_AccountKey, m_Location);
LeClient.Write(ASCII.GetBytes(header), 0, header.Length);
}
}
catch (Exception ex)
{
throw new IOException("An error occurred while opening the connection.", ex);
}
}
protected virtual void ReopenConnection()
{
CloseConnection();
var rootDelay = MinDelay;
while (true)
{
try
{
OpenConnection();
return;
}
catch (Exception ex)
{
if (m_Debug)
{
WriteDebugMessages("Unable to connect to Logentries API.", ex);
}
}
rootDelay *= 2;
if (rootDelay > MaxDelay)
rootDelay = MaxDelay;
var waitFor = rootDelay + Random.Next(rootDelay);
try
{
Thread.Sleep(waitFor);
}
catch
{
throw new ThreadInterruptedException();
}
}
}
protected virtual void CloseConnection()
{
if (LeClient != null)
LeClient.Close();
}
public static bool IsNullOrWhiteSpace(String value)
{
if (value == null) return true;
for (int i = 0; i < value.Length; i++)
{
if (!Char.IsWhiteSpace(value[i])) return false;
}
return true;
}
private string retrieveSetting(String name)
{
string value;
value = ConfigurationManager.AppSettings[name];
if (IsNullOrWhiteSpace(value))
{
try
{
value = Environment.GetEnvironmentVariable(name);
}
catch (SecurityException)
{
}
}
return value;
}
/*
* Use CloudConfigurationManager with .NET4.0 and fallback to System.Configuration for previous frameworks.
*
* NOTE: This is not entirely clear with regards to the above comment, but this block of code uses a compiler directive NET4_0
* which is not set by default anywhere, so most uses of this code will default back to the "pre-.Net4.0" code branch, even
* if you are using .Net4.0 or .Net4.5.
*
* The second issue is that there are two appsetting keys for each setting - the "legacy" key, such as "LOGENTRIES_TOKEN"
* and the "non-legacy" key, such as "Logentries.Token". Again, I'm not sure of the reasons behind this, so the code below checks
* both the legacy and non-legacy keys, defaulting to the legacy keys if they are found.
*
* It probably should be investigated whether the fallback to ConfigurationManager is needed at all, as CloudConfigurationManager
* will retrieve settings from appSettings in a non-Azure environment.
*/
protected virtual bool LoadCredentials()
{
if (!m_UseHttpPut)
{
if (GetIsValidGuid(m_Token))
return true;
var configToken = retrieveSetting(LegacyConfigTokenName) ?? retrieveSetting(ConfigTokenName);
if (!String.IsNullOrEmpty(configToken) && GetIsValidGuid(configToken))
{
m_Token = configToken;
return true;
}
WriteDebugMessages(InvalidTokenMessage);
return false;
}
if (m_AccountKey != "" && GetIsValidGuid(m_AccountKey) && m_Location != "")
return true;
var configAccountKey = ConfigurationManager.AppSettings[LegacyConfigAccountKeyName] ?? ConfigurationManager.AppSettings[ConfigAccountKeyName];
if (!String.IsNullOrEmpty(configAccountKey) && GetIsValidGuid(configAccountKey))
{
m_AccountKey = configAccountKey;
var configLocation = ConfigurationManager.AppSettings[LegacyConfigLocationName] ?? ConfigurationManager.AppSettings[ConfigLocationName];
if (!String.IsNullOrEmpty(configLocation))
{
m_Location = configLocation;
return true;
}
}
WriteDebugMessages(InvalidHttpPutCredentialsMessage);
return false;
}
private bool CheckIfHostNameValid(String hostName)
{
return !ForbiddenHostNameChars.IsMatch(hostName); // Returns false if reg.ex. matches any of forbidden chars.
}
static bool IsGuid(string candidate, out Guid output)
{
bool isValid = false;
output = Guid.Empty;
if (isGuid.IsMatch(candidate))
{
output = new Guid(candidate);
isValid = true;
}
return isValid;
}
protected virtual bool GetIsValidGuid(string guidString)
{
if (String.IsNullOrEmpty(guidString))
return false;
System.Guid newGuid = System.Guid.NewGuid();
return IsGuid(guidString, out newGuid);
}
protected virtual void WriteDebugMessages(string message, Exception ex)
{
if (!m_Debug)
return;
message = LeSignature + message;
string[] messages = { message, ex.ToString() };
foreach (var msg in messages)
{
// Use below line instead when compiling with log4net1.2.10.
//LogLog.Debug(msg);
//LogLog.Debug(typeof(LogentriesAppender), msg);
Debug.WriteLine(message);
}
}
protected virtual void WriteDebugMessages(string message)
{
if (!m_Debug)
return;
message = LeSignature + message;
// Use below line instead when compiling with log4net1.2.10.
//LogLog.Debug(message);
//LogLog.Debug(typeof(LogentriesAppender), message);
Debug.WriteLine(message);
}
#endregion
#region publicMethods
public virtual void AddLine(string line)
{
if (!IsRunning)
{
// We need to load user credentials only
// if the configuration does not state that DataHub is used;
// credentials needed only if logs are sent to LE service directly.
bool credentialsLoaded = false;
if(!m_UseDataHub)
{
credentialsLoaded = LoadCredentials();
}
// If in DataHub mode credentials are ignored.
if (credentialsLoaded || m_UseDataHub)
{
WriteDebugMessages("Starting Logentries asynchronous socket client.");
WorkerThread.Start();
IsRunning = true;
}
}
WriteDebugMessages("Queueing: " + line);
String trimmedEvent = line.TrimEnd(TrimChars);
// Try to append data to queue.
if (!Queue.TryAdd(trimmedEvent))
{
Queue.Take();
if (!Queue.TryAdd(trimmedEvent))
WriteDebugMessages(QueueOverflowMessage);
}
}
public void interruptWorker()
{
WorkerThread.Interrupt();
}
#endregion
}
}

View File

@@ -1,103 +0,0 @@
using System;
using System.IO;
using System.Net.Security;
using System.Net.Sockets;
namespace LogentriesCore
{
class LeClient
{
// Logentries API server address.
protected const String LeApiUrl = "api.logentries.com";
// Port number for token logging on Logentries API server.
protected const int LeApiTokenPort = 10000;
// Port number for TLS encrypted token logging on Logentries API server
protected const int LeApiTokenTlsPort = 20000;
// Port number for HTTP PUT logging on Logentries API server.
protected const int LeApiHttpPort = 80;
// Port number for SSL HTTP PUT logging on Logentries API server.
protected const int LeApiHttpsPort = 443;
// Creates LeClient instance. If do not define useServerUrl and/or useOverrideProt during call
// LeClient will be configured to work with api.logentries.com server; otherwise - with
// defined server on defined port.
public LeClient(bool useHttpPut, bool useSsl, bool useDataHub, String serverAddr, int port)
{
// Override port number and server address to send logs to DataHub instance.
if (useDataHub)
{
m_UseSsl = false; // DataHub does not support receiving log messages over SSL for now.
m_TcpPort = port;
m_ServerAddr = serverAddr;
}
else
{
m_UseSsl = useSsl;
if (!m_UseSsl)
m_TcpPort = useHttpPut ? LeApiHttpPort : LeApiTokenPort;
else
m_TcpPort = useHttpPut ? LeApiHttpsPort : LeApiTokenTlsPort;
}
}
private bool m_UseSsl = false;
private int m_TcpPort;
private TcpClient m_Client = null;
private Stream m_Stream = null;
private SslStream m_SslStream = null;
private String m_ServerAddr = LeApiUrl; // By default m_ServerAddr points to api.logentries.com if useDataHub is not set to true.
private Stream ActiveStream
{
get
{
return m_UseSsl ? m_SslStream : m_Stream;
}
}
public void Connect()
{
m_Client = new TcpClient(m_ServerAddr, m_TcpPort);
m_Client.NoDelay = true;
m_Stream = m_Client.GetStream();
if (m_UseSsl)
{
m_SslStream = new SslStream(m_Stream);
m_SslStream.AuthenticateAsClient(m_ServerAddr);
}
}
public void Write(byte[] buffer, int offset, int count)
{
ActiveStream.Write(buffer, offset, count);
}
public void Flush()
{
ActiveStream.Flush();
}
public void Close()
{
if (m_Client != null)
{
try
{
m_Client.Close();
}
catch
{
}
}
}
}
}

View File

@@ -1,83 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{90D6E9FC-7B88-4E1B-B018-8FA742274558}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>LogentriesCore</RootNamespace>
<AssemblyName>LogentriesCore</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<RestorePackages>true</RestorePackages>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="AsyncLogger.cs" />
<Compile Include="LeClient.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@@ -1,35 +0,0 @@
using System.Reflection;
using System.Runtime.InteropServices;
// 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("LogentriesCore")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("LogentriesCore")]
[assembly: AssemblyCopyright("Copyright © 2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 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)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("14055980-6937-4745-9449-dabf47c1d892")]
// 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("2.6.0.0")]
[assembly: AssemblyFileVersion("2.6.0.0")]

View File

@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="2.0.1.0" targetFramework="net40" />
</packages>

View File

@@ -1,97 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{9DC31DE3-79FF-47A8-96B4-6BA18F6BB1CB}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>LogentriesNLog</RootNamespace>
<AssemblyName>LogentriesNLog</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<RestorePackages>true</RestorePackages>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.3.11\lib\net40\NLog.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="fastJSON\Getters.cs" />
<Compile Include="fastJSON\JSON.cs" />
<Compile Include="fastJSON\JsonParser.cs" />
<Compile Include="fastJSON\JsonSerializer.cs" />
<Compile Include="fastJSON\SafeDictionary.cs" />
<Compile Include="LogentriesTarget.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LogentriesCore\LogentriesCore.csproj">
<Project>{90D6E9FC-7B88-4E1B-B018-8FA742274558}</Project>
<Name>LogentriesCore</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="fastJSON\license.txt" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@@ -1,150 +0,0 @@
using System;
using LogentriesCore;
using LogentriesNLog.fastJSON;
using NLog;
using NLog.Targets;
namespace LogentriesNLog
{
[Target("Logentries")]
public sealed class LogentriesTarget : TargetWithLayout
{
private AsyncLogger logentriesAsync;
public LogentriesTarget()
{
logentriesAsync = new AsyncLogger();
logentriesAsync.setImmediateFlush(true);
}
/** Debug flag. */
public bool Debug
{
get { return logentriesAsync.getDebug(); }
set { logentriesAsync.setDebug(value); }
}
/** Is using DataHub parameter flag. - ste to true if it is needed to send messages to DataHub instance. */
public bool IsUsingDataHub
{
get { return logentriesAsync.getIsUsingDataHab(); }
set { logentriesAsync.setIsUsingDataHub(value); }
}
/** DataHub server address */
public String DataHubAddr
{
get { return logentriesAsync.getDataHubAddr(); }
set { logentriesAsync.setDataHubAddr(value); }
}
/** DataHub server port */
public int DataHubPort
{
get { return logentriesAsync.getDataHubPort(); }
set { logentriesAsync.setDataHubPort(value); }
}
/** Option to set Token programmatically or in Appender Definition */
public string Token
{
get { return logentriesAsync.getToken(); }
set { logentriesAsync.setToken(value); }
}
/** HTTP PUT Flag */
public bool HttpPut
{
get { return logentriesAsync.getUseHttpPut(); }
set { logentriesAsync.setUseHttpPut(value); }
}
/** SSL/TLS parameter flag */
public bool Ssl
{
get { return logentriesAsync.getUseSsl(); }
set { logentriesAsync.setUseSsl(value); }
}
/** ACCOUNT_KEY parameter for HTTP PUT logging */
public String Key
{
get { return logentriesAsync.getAccountKey(); }
set { logentriesAsync.setAccountKey(value); }
}
/** LOCATION parameter for HTTP PUT logging */
public String Location
{
get { return logentriesAsync.getLocation(); }
set { logentriesAsync.setLocation(value); }
}
/* LogHostname - switch that defines whether add host name to the log message */
public bool LogHostname
{
get { return logentriesAsync.getUseHostName(); }
set { logentriesAsync.setUseHostName(value); }
}
/* HostName - user-defined host name. If empty the library will try to obtain it automatically */
public String HostName
{
get { return logentriesAsync.getHostName(); }
set { logentriesAsync.setHostName(value); }
}
/* User-defined log message ID */
public String LogID
{
get { return logentriesAsync.getLogID(); }
set { logentriesAsync.setLogID(value); }
}
public bool KeepConnection { get; set; }
protected override void Write(LogEventInfo logEvent)
{
//Render message content
var log = new Log
{
Level = logEvent.Level.ToString(),
Logger = logEvent.LoggerName,
Message = logEvent.FormattedMessage,
Time = logEvent.TimeStamp,
};
//NLog can pass null references of Exception
if (logEvent.Exception != null)
{
log.Exception = logEvent.Exception.ToString();
log.ExceptionType = logEvent.Exception.GetType().ToString();
}
logentriesAsync.AddLine(JSON.Instance.ToJSON(log));
}
protected override void CloseTarget()
{
base.CloseTarget();
logentriesAsync.interruptWorker();
}
}
public class Log
{
public string Message { get; set; }
public DateTime Time { get; set; }
public string Logger { get; set; }
public string Exception { get; set; }
public string ExceptionType { get; set; }
public String Level { get; set; }
}
}

View File

@@ -1,35 +0,0 @@
using System.Reflection;
using System.Runtime.InteropServices;
// 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("LogentriesNLog")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("LogentriesNLog")]
[assembly: AssemblyCopyright("Copyright © 2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 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)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("7e04ff2d-ea59-4b62-969d-72bd3e37c684")]
// 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("2.4.0.0")]
[assembly: AssemblyFileVersion("2.4.0.0")]

View File

@@ -1,21 +0,0 @@
//http://fastjson.codeplex.com/
//http://fastjson.codeplex.com/license
using System;
using System.Collections.Generic;
namespace LogentriesNLog.fastJSON
{
internal class Getters
{
public string Name;
public JSON.GenericGetter Getter;
public Type propertyType;
}
internal class DatasetSchema
{
public List<string> Info { get; set; }
public string Name { get; set; }
}
}

View File

@@ -1,821 +0,0 @@
//http://fastjson.codeplex.com/
//http://fastjson.codeplex.com/license
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Globalization;
using System.IO;
using System.Reflection;
using System.Reflection.Emit;
using System.Xml.Serialization;
namespace LogentriesNLog.fastJSON
{
internal class JSON
{
public readonly static JSON Instance = new JSON();
private JSON()
{
UseSerializerExtension = false;
SerializeNullValues = false;
UseOptimizedDatasetSchema = false;
UsingGlobalTypes = false;
UseUTCDateTime = true;
}
public bool UseOptimizedDatasetSchema = true;
public bool UseFastGuid = true;
public bool UseSerializerExtension = true;
public bool IndentOutput = false;
public bool SerializeNullValues = true;
public bool UseUTCDateTime = false;
public bool ShowReadOnlyProperties = false;
public bool UsingGlobalTypes = true;
public string ToJSON(object obj)
{
return ToJSON(obj, UseSerializerExtension, UseFastGuid, UseOptimizedDatasetSchema, SerializeNullValues);
}
public string ToJSON(object obj,
bool enableSerializerExtensions,
bool enableFastGuid,
bool enableOptimizedDatasetSchema,
bool serializeNullValues)
{
return new JSONSerializer(enableOptimizedDatasetSchema, enableFastGuid, enableSerializerExtensions, serializeNullValues, IndentOutput).ConvertToJSON(obj);
}
public T ToObject<T>(string json)
{
return (T)ToObject(json, typeof(T));
}
public object ToObject(string json, Type type)
{
var ht = new JsonParser(json).Decode() as Dictionary<string, object>;
if (ht == null) return null;
return ParseDictionary(ht, null, type);
}
#if CUSTOMTYPE
internal SafeDictionary<Type, Serialize> _customSerializer = new SafeDictionary<Type, Serialize>();
internal SafeDictionary<Type, Deserialize> _customDeserializer = new SafeDictionary<Type, Deserialize>();
public void RegisterCustomType(Type type, Serialize serializer, Deserialize deserializer)
{
if (type != null && serializer != null && deserializer != null)
{
_customSerializer.Add(type, serializer);
_customDeserializer.Add(type, deserializer);
// reset property cache
_propertycache = new SafeDictionary<string, SafeDictionary<string, myPropInfo>>();
}
}
internal bool IsTypeRegistered(Type t)
{
Serialize s;
return _customSerializer.TryGetValue(t, out s);
}
#endif
#region [ PROPERTY GET SET CACHE ]
readonly SafeDictionary<Type, string> _tyname = new SafeDictionary<Type, string>();
internal string GetTypeAssemblyName(Type t)
{
string val = "";
if (_tyname.TryGetValue(t, out val))
return val;
string s = t.AssemblyQualifiedName;
_tyname.Add(t, s);
return s;
}
readonly SafeDictionary<string, Type> _typecache = new SafeDictionary<string, Type>();
private Type GetTypeFromCache(string typename)
{
Type val = null;
if (_typecache.TryGetValue(typename, out val))
return val;
Type t = Type.GetType(typename);
_typecache.Add(typename, t);
return t;
}
readonly SafeDictionary<Type, CreateObject> _constrcache = new SafeDictionary<Type, CreateObject>();
private delegate object CreateObject();
private object FastCreateInstance(Type objtype)
{
try
{
CreateObject c = null;
if (_constrcache.TryGetValue(objtype, out c))
{
return c();
}
DynamicMethod dynMethod = new DynamicMethod("_", objtype, null, true);
ILGenerator ilGen = dynMethod.GetILGenerator();
ilGen.Emit(OpCodes.Newobj, objtype.GetConstructor(Type.EmptyTypes));
ilGen.Emit(OpCodes.Ret);
c = (CreateObject)dynMethod.CreateDelegate(typeof(CreateObject));
_constrcache.Add(objtype, c);
return c();
}
catch (Exception exc)
{
throw new Exception(string.Format("Failed to fast create instance for type '{0}' from assemebly '{1}'",
objtype.FullName, objtype.AssemblyQualifiedName), exc);
}
}
private struct myPropInfo
{
public bool filled;
public Type pt;
public Type bt;
public Type changeType;
public bool isDictionary;
public bool isValueType;
public bool isGenericType;
public bool isArray;
public bool isByteArray;
public bool isGuid;
#if !SILVERLIGHT
public bool isDataSet;
public bool isDataTable;
public bool isHashtable;
#endif
public GenericSetter setter;
public bool isEnum;
public bool isDateTime;
public Type[] GenericTypes;
public bool isInt;
public bool isLong;
public bool isString;
public bool isBool;
public bool isClass;
public GenericGetter getter;
public bool isStringDictionary;
public string Name;
#if CUSTOMTYPE
public bool isCustomType;
#endif
public bool CanWrite;
}
readonly SafeDictionary<string, SafeDictionary<string, myPropInfo>> _propertycache = new SafeDictionary<string, SafeDictionary<string, myPropInfo>>();
private SafeDictionary<string, myPropInfo> Getproperties(Type type, string typename)
{
SafeDictionary<string, myPropInfo> sd = null;
if (_propertycache.TryGetValue(typename, out sd))
{
return sd;
}
sd = new SafeDictionary<string, myPropInfo>();
var pr = type.GetProperties(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance);
foreach (var p in pr)
{
myPropInfo d = CreateMyProp(p.PropertyType, p.Name);
d.CanWrite = p.CanWrite;
d.setter = CreateSetMethod(p);
d.getter = CreateGetMethod(p);
sd.Add(p.Name, d);
}
_propertycache.Add(typename, sd);
return sd;
}
private myPropInfo CreateMyProp(Type t, string name)
{
myPropInfo d = new myPropInfo();
d.filled = true;
d.CanWrite = true;
d.pt = t;
d.Name = name;
d.isDictionary = t.Name.Contains("Dictionary");
if (d.isDictionary)
d.GenericTypes = t.GetGenericArguments();
d.isValueType = t.IsValueType;
d.isGenericType = t.IsGenericType;
d.isArray = t.IsArray;
if (d.isArray)
d.bt = t.GetElementType();
if (d.isGenericType)
d.bt = t.GetGenericArguments()[0];
d.isByteArray = t == typeof(byte[]);
d.isGuid = (t == typeof(Guid) || t == typeof(Guid?));
#if !SILVERLIGHT
d.isHashtable = t == typeof(Hashtable);
d.isDataSet = t == typeof(DataSet);
d.isDataTable = t == typeof(DataTable);
#endif
d.changeType = GetChangeType(t);
d.isEnum = t.IsEnum;
d.isDateTime = t == typeof(DateTime) || t == typeof(DateTime?);
d.isInt = t == typeof(int) || t == typeof(int?);
d.isLong = t == typeof(long) || t == typeof(long?);
d.isString = t == typeof(string);
d.isBool = t == typeof(bool) || t == typeof(bool?);
d.isClass = t.IsClass;
if (d.isDictionary && d.GenericTypes.Length > 0 && d.GenericTypes[0] == typeof(string))
d.isStringDictionary = true;
#if CUSTOMTYPE
if (IsTypeRegistered(t))
d.isCustomType = true;
#endif
return d;
}
private delegate void GenericSetter(object target, object value);
private static GenericSetter CreateSetMethod(PropertyInfo propertyInfo)
{
MethodInfo setMethod = propertyInfo.GetSetMethod(nonPublic: true);
if (setMethod == null)
return null;
var arguments = new Type[2];
arguments[0] = arguments[1] = typeof(object);
DynamicMethod setter = new DynamicMethod("_", typeof(void), arguments, true);
ILGenerator il = setter.GetILGenerator();
il.Emit(OpCodes.Ldarg_0);
il.Emit(OpCodes.Castclass, propertyInfo.DeclaringType);
il.Emit(OpCodes.Ldarg_1);
if (propertyInfo.PropertyType.IsClass)
il.Emit(OpCodes.Castclass, propertyInfo.PropertyType);
else
il.Emit(OpCodes.Unbox_Any, propertyInfo.PropertyType);
il.EmitCall(OpCodes.Callvirt, setMethod, null);
il.Emit(OpCodes.Ret);
return (GenericSetter)setter.CreateDelegate(typeof(GenericSetter));
}
internal delegate object GenericGetter(object obj);
private GenericGetter CreateGetMethod(PropertyInfo propertyInfo)
{
MethodInfo getMethod = propertyInfo.GetGetMethod();
if (getMethod == null)
return null;
var arguments = new Type[1];
arguments[0] = typeof(object);
DynamicMethod getter = new DynamicMethod("_", typeof(object), arguments, true);
ILGenerator il = getter.GetILGenerator();
il.Emit(OpCodes.Ldarg_0);
il.Emit(OpCodes.Castclass, propertyInfo.DeclaringType);
il.EmitCall(OpCodes.Callvirt, getMethod, null);
if (!propertyInfo.PropertyType.IsClass)
il.Emit(OpCodes.Box, propertyInfo.PropertyType);
il.Emit(OpCodes.Ret);
return (GenericGetter)getter.CreateDelegate(typeof(GenericGetter));
}
readonly SafeDictionary<Type, List<Getters>> _getterscache = new SafeDictionary<Type, List<Getters>>();
internal List<Getters> GetGetters(Type type)
{
List<Getters> val = null;
if (_getterscache.TryGetValue(type, out val))
return val;
var props = type.GetProperties(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance);
var getters = new List<Getters>();
foreach (var p in props)
{
if (!p.CanWrite && ShowReadOnlyProperties == false) continue;
var att = p.GetCustomAttributes(typeof(XmlIgnoreAttribute), false);
if (att != null && att.Length > 0)
continue;
GenericGetter g = CreateGetMethod(p);
if (g != null)
{
Getters gg = new Getters();
gg.Name = p.Name;
gg.Getter = g;
gg.propertyType = p.PropertyType;
getters.Add(gg);
}
}
_getterscache.Add(type, getters);
return getters;
}
private object ChangeType(object value, Type conversionType)
{
if (conversionType == typeof(int))
return (int)CreateLong((string)value);
if (conversionType == typeof(long))
return CreateLong((string)value);
if (conversionType == typeof(string))
return value;
if (conversionType == typeof(Guid))
return CreateGuid((string)value);
if (conversionType.IsEnum)
return CreateEnum(conversionType, (string)value);
return Convert.ChangeType(value, conversionType, CultureInfo.InvariantCulture);
}
#endregion
private object ParseDictionary(Dictionary<string, object> d, Dictionary<string, object> globaltypes, Type type)
{
object tn = "";
if (d.TryGetValue("$types", out tn))
{
UsingGlobalTypes = true;
globaltypes = new Dictionary<string, object>();
foreach (var kv in (Dictionary<string, object>)tn)
{
globaltypes.Add((string)kv.Value, kv.Key);
}
}
bool found = d.TryGetValue("$type", out tn);
#if !SILVERLIGHT
if (found == false && type == typeof(Object))
{
return CreateDataset(d, globaltypes);
}
#endif
if (found)
{
if (UsingGlobalTypes)
{
object tname = "";
if (globaltypes.TryGetValue((string)tn, out tname))
tn = tname;
}
type = GetTypeFromCache((string)tn);
}
if (type == null)
throw new Exception("Cannot determine type");
string typename = type.FullName;
object o = FastCreateInstance(type);
var props = Getproperties(type, typename);
foreach (var name in d.Keys)
{
if (name == "$map")
{
ProcessMap(o, props, (Dictionary<string, object>)d[name]);
continue;
}
myPropInfo pi;
if (props.TryGetValue(name, out pi) == false)
continue;
if (pi.filled)
{
object v = d[name];
if (v != null)
{
object oset = null;
if (pi.isInt)
oset = (int)CreateLong((string)v);
#if CUSTOMTYPE
else if (pi.isCustomType)
oset = CreateCustom((string)v, pi.pt);
#endif
else if (pi.isLong)
oset = CreateLong((string)v);
else if (pi.isString)
oset = v;
else if (pi.isBool)
oset = (bool)v;
else if (pi.isGenericType && pi.isValueType == false && pi.isDictionary == false)
#if SILVERLIGHT
oset = CreateGenericList((List<object>)v, pi.pt, pi.bt, globaltypes);
#else
oset = CreateGenericList((ArrayList)v, pi.pt, pi.bt, globaltypes);
#endif
else if (pi.isByteArray)
oset = Convert.FromBase64String((string)v);
else if (pi.isArray && pi.isValueType == false)
#if SILVERLIGHT
oset = CreateArray((List<object>)v, pi.pt, pi.bt, globaltypes);
#else
oset = CreateArray((ArrayList)v, pi.pt, pi.bt, globaltypes);
#endif
else if (pi.isGuid)
oset = CreateGuid((string)v);
#if !SILVERLIGHT
else if (pi.isDataSet)
oset = CreateDataset((Dictionary<string, object>)v, globaltypes);
else if (pi.isDataTable)
oset = CreateDataTable((Dictionary<string, object>)v, globaltypes);
#endif
else if (pi.isStringDictionary)
oset = CreateStringKeyDictionary((Dictionary<string, object>)v, pi.pt, pi.GenericTypes, globaltypes);
#if !SILVERLIGHT
else if (pi.isDictionary || pi.isHashtable)
oset = CreateDictionary((ArrayList)v, pi.pt, pi.GenericTypes, globaltypes);
#else
else if (pi.isDictionary)
oset = CreateDictionary((List<object>)v, pi.pt, pi.GenericTypes, globaltypes);
#endif
else if (pi.isEnum)
oset = CreateEnum(pi.pt, (string)v);
else if (pi.isDateTime)
oset = CreateDateTime((string)v);
else if (pi.isClass && v is Dictionary<string, object>)
oset = ParseDictionary((Dictionary<string, object>)v, globaltypes, pi.pt);
else if (pi.isValueType)
oset = ChangeType(v, pi.changeType);
#if SILVERLIGHT
else if (v is List<object>)
oset = CreateArray((List<object>)v, pi.pt, typeof(object), globaltypes);
#else
else if (v is ArrayList)
oset = CreateArray((ArrayList)v, pi.pt, typeof(object), globaltypes);
#endif
else
oset = v;
if (pi.CanWrite)
pi.setter(o, oset);
}
}
}
return o;
}
#if CUSTOMTYPE
private object CreateCustom(string v, Type type)
{
Deserialize d;
_customDeserializer.TryGetValue(type, out d);
return d(v);
}
#endif
private void ProcessMap(object obj, SafeDictionary<string, myPropInfo> props, Dictionary<string, object> dic)
{
foreach (var kv in dic)
{
myPropInfo p = props[kv.Key];
object o = p.getter(obj);
Type t = Type.GetType((string)kv.Value);
if (t == typeof(Guid))
p.setter(obj, CreateGuid((string)o));
}
}
private long CreateLong(string s)
{
long num = 0;
bool neg = false;
foreach (var cc in s)
{
if (cc == '-')
neg = true;
else if (cc == '+')
neg = false;
else
{
num *= 10;
num += (cc - '0');
}
}
return neg ? -num : num;
}
private object CreateEnum(Type pt, string v)
{
// TODO : optimize create enum
#if !SILVERLIGHT
return Enum.Parse(pt, v);
#else
return Enum.Parse(pt, v, true);
#endif
}
private Guid CreateGuid(string s)
{
if (s.Length > 30)
return new Guid(s);
return new Guid(Convert.FromBase64String(s));
}
private DateTime CreateDateTime(string value)
{
bool utc = false;
// 0123456789012345678
// datetime format = yyyy-MM-dd HH:mm:ss
int year = (int)CreateLong(value.Substring(0, 4));
int month = (int)CreateLong(value.Substring(5, 2));
int day = (int)CreateLong(value.Substring(8, 2));
int hour = (int)CreateLong(value.Substring(11, 2));
int min = (int)CreateLong(value.Substring(14, 2));
int sec = (int)CreateLong(value.Substring(17, 2));
if (value.EndsWith("Z"))
utc = true;
if (UseUTCDateTime == false && utc == false)
return new DateTime(year, month, day, hour, min, sec);
return new DateTime(year, month, day, hour, min, sec, DateTimeKind.Utc).ToLocalTime();
}
#if SILVERLIGHT
private object CreateArray(List<object> data, Type pt, Type bt, Dictionary<string, object> globalTypes)
{
Array col = Array.CreateInstance(bt, data.Count);
// create an array of objects
for (int i = 0; i < data.Count; i++)// each (object ob in data)
{
object ob = data[i];
if (ob is IDictionary)
col.SetValue(ParseDictionary((Dictionary<string, object>)ob, globalTypes, bt), i);
else
col.SetValue(ChangeType(ob, bt), i);
}
return col;
}
#else
private object CreateArray(ArrayList data, Type pt, Type bt, Dictionary<string, object> globalTypes)
{
ArrayList col = new ArrayList();
// create an array of objects
foreach (var ob in data)
{
if (ob is IDictionary)
col.Add(ParseDictionary((Dictionary<string, object>)ob, globalTypes, bt));
else
col.Add(ChangeType(ob, bt));
}
return col.ToArray(bt);
}
#endif
#if SILVERLIGHT
private object CreateGenericList(List<object> data, Type pt, Type bt, Dictionary<string, object> globalTypes)
#else
private object CreateGenericList(ArrayList data, Type pt, Type bt, Dictionary<string, object> globalTypes)
#endif
{
IList col = (IList)FastCreateInstance(pt);
// create an array of objects
foreach (var ob in data)
{
if (ob is IDictionary)
col.Add(ParseDictionary((Dictionary<string, object>)ob, globalTypes, bt));
#if SILVERLIGHT
else if (ob is List<object>)
col.Add(((List<object>)ob).ToArray());
#else
else if (ob is ArrayList)
col.Add(((ArrayList)ob).ToArray());
#endif
else
col.Add(ChangeType(ob, bt));
}
return col;
}
private object CreateStringKeyDictionary(Dictionary<string, object> reader, Type pt, Type[] types, Dictionary<string, object> globalTypes)
{
var col = (IDictionary)FastCreateInstance(pt);
Type t1 = null;
Type t2 = null;
if (types != null)
{
t1 = types[0];
t2 = types[1];
}
foreach (var values in reader)
{
var key = values.Key;//ChangeType(values.Key, t1);
object val = null;
if (values.Value is Dictionary<string, object>)
val = ParseDictionary((Dictionary<string, object>)values.Value, globalTypes, t2);
else
val = ChangeType(values.Value, t2);
col.Add(key, val);
}
return col;
}
#if SILVERLIGHT
private object CreateDictionary(List<object> reader, Type pt, Type[] types, Dictionary<string, object> globalTypes)
#else
private object CreateDictionary(ArrayList reader, Type pt, Type[] types, Dictionary<string, object> globalTypes)
#endif
{
IDictionary col = (IDictionary)FastCreateInstance(pt);
Type t1 = null;
Type t2 = null;
if (types != null)
{
t1 = types[0];
t2 = types[1];
}
foreach (Dictionary<string, object> values in reader)
{
object key = values["k"];
object val = values["v"];
if (key is Dictionary<string, object>)
key = ParseDictionary((Dictionary<string, object>)key, globalTypes, t1);
else
key = ChangeType(key, t1);
if (val is Dictionary<string, object>)
val = ParseDictionary((Dictionary<string, object>)val, globalTypes, t2);
else
val = ChangeType(val, t2);
col.Add(key, val);
}
return col;
}
private Type GetChangeType(Type conversionType)
{
if (conversionType.IsGenericType && conversionType.GetGenericTypeDefinition().Equals(typeof(Nullable<>)))
return conversionType.GetGenericArguments()[0];
return conversionType;
}
#if !SILVERLIGHT
private DataSet CreateDataset(Dictionary<string, object> reader, Dictionary<string, object> globalTypes)
{
DataSet ds = new DataSet();
ds.EnforceConstraints = false;
ds.BeginInit();
// read dataset schema here
ReadSchema(reader, ds, globalTypes);
foreach (var pair in reader)
{
if (pair.Key == "$type" || pair.Key == "$schema") continue;
ArrayList rows = (ArrayList)pair.Value;
if (rows == null) continue;
DataTable dt = ds.Tables[pair.Key];
ReadDataTable(rows, dt);
}
ds.EndInit();
return ds;
}
private void ReadSchema(Dictionary<string, object> reader, DataSet ds, Dictionary<string, object> globalTypes)
{
var schema = reader["$schema"];
if (schema is string)
{
TextReader tr = new StringReader((string)schema);
ds.ReadXmlSchema(tr);
}
else
{
DatasetSchema ms = (DatasetSchema)ParseDictionary((Dictionary<string, object>)schema, globalTypes, typeof(DatasetSchema));
ds.DataSetName = ms.Name;
for (int i = 0; i < ms.Info.Count; i += 3)
{
if (ds.Tables.Contains(ms.Info[i]) == false)
ds.Tables.Add(ms.Info[i]);
ds.Tables[ms.Info[i]].Columns.Add(ms.Info[i + 1], Type.GetType(ms.Info[i + 2]));
}
}
}
private void ReadDataTable(ArrayList rows, DataTable dt)
{
dt.BeginInit();
dt.BeginLoadData();
var guidcols = new List<int>();
var datecol = new List<int>();
foreach (DataColumn c in dt.Columns)
{
if (c.DataType == typeof(Guid) || c.DataType == typeof(Guid?))
guidcols.Add(c.Ordinal);
if (UseUTCDateTime && (c.DataType == typeof(DateTime) || c.DataType == typeof(DateTime?)))
datecol.Add(c.Ordinal);
}
foreach (ArrayList row in rows)
{
var v = new object[row.Count];
row.CopyTo(v, 0);
foreach (var i in guidcols)
{
string s = (string)v[i];
if (s != null && s.Length < 36)
v[i] = new Guid(Convert.FromBase64String(s));
}
if (UseUTCDateTime)
{
foreach (var i in datecol)
{
string s = (string)v[i];
if (s != null)
v[i] = CreateDateTime(s);
}
}
dt.Rows.Add(v);
}
dt.EndLoadData();
dt.EndInit();
}
DataTable CreateDataTable(Dictionary<string, object> reader, Dictionary<string, object> globalTypes)
{
var dt = new DataTable();
// read dataset schema here
var schema = reader["$schema"];
if (schema is string)
{
TextReader tr = new StringReader((string)schema);
dt.ReadXmlSchema(tr);
}
else
{
var ms = (DatasetSchema)ParseDictionary((Dictionary<string, object>)schema, globalTypes, typeof(DatasetSchema));
dt.TableName = ms.Info[0];
for (int i = 0; i < ms.Info.Count; i += 3)
{
dt.Columns.Add(ms.Info[i + 1], Type.GetType(ms.Info[i + 2]));
}
}
foreach (var pair in reader)
{
if (pair.Key == "$type" || pair.Key == "$schema")
continue;
var rows = (ArrayList)pair.Value;
if (rows == null)
continue;
if (!dt.TableName.Equals(pair.Key, StringComparison.InvariantCultureIgnoreCase))
continue;
ReadDataTable(rows, dt);
}
return dt;
}
#endif
}
}

View File

@@ -1,409 +0,0 @@
//http://fastjson.codeplex.com/
//http://fastjson.codeplex.com/license
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
namespace LogentriesNLog.fastJSON
{
/// <summary>
/// This class encodes and decodes JSON strings.
/// Spec. details, see http://www.json.org/
///
/// JSON uses Arrays and Objects. These correspond here to the datatypes ArrayList and Hashtable.
/// All numbers are parsed to doubles.
/// </summary>
internal class JsonParser
{
enum Token
{
None = -1, // Used to denote no Lookahead available
Curly_Open,
Curly_Close,
Squared_Open,
Squared_Close,
Colon,
Comma,
String,
Number,
True,
False,
Null
}
readonly char[] json;
readonly StringBuilder s = new StringBuilder();
Token lookAheadToken = Token.None;
int index;
internal JsonParser(string json)
{
this.json = json.ToCharArray();
}
public object Decode()
{
return ParseValue();
}
private Dictionary<string, object> ParseObject()
{
var table = new Dictionary<string, object>();
ConsumeToken(); // {
while (true)
{
switch (LookAhead())
{
case Token.Comma:
ConsumeToken();
break;
case Token.Curly_Close:
ConsumeToken();
return table;
default:
{
// name
string name = ParseString();
// :
if (NextToken() != Token.Colon)
{
throw new Exception("Expected colon at index " + index);
}
// value
object value = ParseValue();
table[name] = value;
}
break;
}
}
}
#if SILVERLIGHT
private List<object> ParseArray()
{
List<object> array = new List<object>();
#else
private ArrayList ParseArray()
{
ArrayList array = new ArrayList();
#endif
ConsumeToken(); // [
while (true)
{
switch (LookAhead())
{
case Token.Comma:
ConsumeToken();
break;
case Token.Squared_Close:
ConsumeToken();
return array;
default:
{
array.Add(ParseValue());
}
break;
}
}
}
private object ParseValue()
{
switch (LookAhead())
{
case Token.Number:
return ParseNumber();
case Token.String:
return ParseString();
case Token.Curly_Open:
return ParseObject();
case Token.Squared_Open:
return ParseArray();
case Token.True:
ConsumeToken();
return true;
case Token.False:
ConsumeToken();
return false;
case Token.Null:
ConsumeToken();
return null;
}
throw new Exception("Unrecognized token at index" + index);
}
private string ParseString()
{
ConsumeToken(); // "
s.Length = 0;
int runIndex = -1;
while (index < json.Length)
{
var c = json[index++];
if (c == '"')
{
if (runIndex != -1)
{
if (s.Length == 0)
return new string(json, runIndex, index - runIndex - 1);
s.Append(json, runIndex, index - runIndex - 1);
}
return s.ToString();
}
if (c != '\\')
{
if (runIndex == -1)
runIndex = index - 1;
continue;
}
if (index == json.Length) break;
if (runIndex != -1)
{
s.Append(json, runIndex, index - runIndex - 1);
runIndex = -1;
}
switch (json[index++])
{
case '"':
s.Append('"');
break;
case '\\':
s.Append('\\');
break;
case '/':
s.Append('/');
break;
case 'b':
s.Append('\b');
break;
case 'f':
s.Append('\f');
break;
case 'n':
s.Append('\n');
break;
case 'r':
s.Append('\r');
break;
case 't':
s.Append('\t');
break;
case 'u':
{
int remainingLength = json.Length - index;
if (remainingLength < 4) break;
// parse the 32 bit hex into an integer codepoint
uint codePoint = ParseUnicode(json[index], json[index + 1], json[index + 2], json[index + 3]);
s.Append((char)codePoint);
// skip 4 chars
index += 4;
}
break;
}
}
throw new Exception("Unexpectedly reached end of string");
}
private uint ParseSingleChar(char c1, uint multipliyer)
{
uint p1 = 0;
if (c1 >= '0' && c1 <= '9')
p1 = (uint)(c1 - '0') * multipliyer;
else if (c1 >= 'A' && c1 <= 'F')
p1 = (uint)((c1 - 'A') + 10) * multipliyer;
else if (c1 >= 'a' && c1 <= 'f')
p1 = (uint)((c1 - 'a') + 10) * multipliyer;
return p1;
}
private uint ParseUnicode(char c1, char c2, char c3, char c4)
{
uint p1 = ParseSingleChar(c1, 0x1000);
uint p2 = ParseSingleChar(c2, 0x100);
uint p3 = ParseSingleChar(c3, 0x10);
uint p4 = ParseSingleChar(c4, 1);
return p1 + p2 + p3 + p4;
}
private string ParseNumber()
{
ConsumeToken();
// Need to start back one place because the first digit is also a token and would have been consumed
var startIndex = index - 1;
do
{
var c = json[index];
if ((c >= '0' && c <= '9') || c == '.' || c == '-' || c == '+' || c == 'e' || c == 'E')
{
if (++index == json.Length) throw new Exception("Unexpected end of string whilst parsing number");
continue;
}
break;
} while (true);
return new string(json, startIndex, index - startIndex);
}
private Token LookAhead()
{
if (lookAheadToken != Token.None) return lookAheadToken;
return lookAheadToken = NextTokenCore();
}
private void ConsumeToken()
{
lookAheadToken = Token.None;
}
private Token NextToken()
{
var result = lookAheadToken != Token.None ? lookAheadToken : NextTokenCore();
lookAheadToken = Token.None;
return result;
}
private Token NextTokenCore()
{
char c;
// Skip past whitespace
do
{
c = json[index];
if (c > ' ') break;
if (c != ' ' && c != '\t' && c != '\n' && c != '\r') break;
} while (++index < json.Length);
if (index == json.Length)
{
throw new Exception("Reached end of string unexpectedly");
}
c = json[index];
index++;
//if (c >= '0' && c <= '9')
// return Token.Number;
switch (c)
{
case '{':
return Token.Curly_Open;
case '}':
return Token.Curly_Close;
case '[':
return Token.Squared_Open;
case ']':
return Token.Squared_Close;
case ',':
return Token.Comma;
case '"':
return Token.String;
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
case '-': case '+': case '.':
return Token.Number;
case ':':
return Token.Colon;
case 'f':
if (json.Length - index >= 4 &&
json[index + 0] == 'a' &&
json[index + 1] == 'l' &&
json[index + 2] == 's' &&
json[index + 3] == 'e')
{
index += 4;
return Token.False;
}
break;
case 't':
if (json.Length - index >= 3 &&
json[index + 0] == 'r' &&
json[index + 1] == 'u' &&
json[index + 2] == 'e')
{
index += 3;
return Token.True;
}
break;
case 'n':
if (json.Length - index >= 3 &&
json[index + 0] == 'u' &&
json[index + 1] == 'l' &&
json[index + 2] == 'l')
{
index += 3;
return Token.Null;
}
break;
}
throw new Exception("Could not find token at index " + --index);
}
}
}

View File

@@ -1,521 +0,0 @@
//http://fastjson.codeplex.com/
//http://fastjson.codeplex.com/license
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Globalization;
using System.IO;
using System.Text;
namespace LogentriesNLog.fastJSON
{
internal class JSONSerializer
{
private readonly StringBuilder _output = new StringBuilder();
readonly bool useMinimalDataSetSchema;
readonly bool fastguid = true;
readonly bool useExtension = true;
readonly bool serializeNulls = true;
readonly int _MAX_DEPTH = 10;
readonly bool _Indent;
readonly bool _useGlobalTypes = true;
int _current_depth;
private readonly Dictionary<string, int> _globalTypes = new Dictionary<string, int>();
internal JSONSerializer(bool UseMinimalDataSetSchema, bool UseFastGuid, bool UseExtensions, bool SerializeNulls, bool IndentOutput)
{
useMinimalDataSetSchema = UseMinimalDataSetSchema;
fastguid = UseFastGuid;
useExtension = UseExtensions;
_Indent = IndentOutput;
serializeNulls = SerializeNulls;
if (useExtension == false)
_useGlobalTypes = false;
}
internal string ConvertToJSON(object obj)
{
WriteValue(obj);
string str = "";
if (_useGlobalTypes)
{
StringBuilder sb = new StringBuilder();
sb.Append("{\"$types\":{");
bool pendingSeparator = false;
foreach (var kv in _globalTypes)
{
if (pendingSeparator) sb.Append(',');
pendingSeparator = true;
sb.Append("\"");
sb.Append(kv.Key);
sb.Append("\":\"");
sb.Append(kv.Value);
sb.Append("\"");
}
sb.Append("},");
str = sb + _output.ToString();
}
else
str = _output.ToString();
return str;
}
private void WriteValue(object obj)
{
if (obj == null || obj is DBNull)
_output.Append("null");
else if (obj is string || obj is char)
WriteString((string)obj);
else if (obj is Guid)
WriteGuid((Guid)obj);
else if (obj is bool)
_output.Append(((bool)obj) ? "true" : "false"); // conform to standard
else if (
obj is int || obj is long || obj is double ||
obj is decimal || obj is float ||
obj is byte || obj is short ||
obj is sbyte || obj is ushort ||
obj is uint || obj is ulong
)
_output.Append(((IConvertible)obj).ToString(NumberFormatInfo.InvariantInfo));
else if (obj is DateTime)
WriteDateTime((DateTime)obj);
else if (obj is IDictionary && obj.GetType().IsGenericType && obj.GetType().GetGenericArguments()[0] == typeof(string))
WriteStringDictionary((IDictionary)obj);
else if (obj is IDictionary)
WriteDictionary((IDictionary)obj);
#if !SILVERLIGHT
else if (obj is DataSet)
WriteDataset((DataSet)obj);
else if (obj is DataTable)
WriteDataTable((DataTable)obj);
#endif
else if (obj is byte[])
WriteBytes((byte[])obj);
else if (obj is Array || obj is IList || obj is ICollection)
WriteArray((IEnumerable)obj);
else if (obj is Enum)
WriteEnum((Enum)obj);
#if CUSTOMTYPE
else if (JSON.Instance.IsTypeRegistered(obj.GetType()))
WriteCustom(obj);
#endif
else
WriteObject(obj);
}
#if CUSTOMTYPE
private void WriteCustom(object obj)
{
Serialize s;
JSON.Instance._customSerializer.TryGetValue(obj.GetType(), out s);
WriteStringFast(s(obj));
}
#endif
private void WriteEnum(Enum e)
{
// TODO : optimize enum write
WriteStringFast(e.ToString());
}
private void WriteGuid(Guid g)
{
if (fastguid == false)
WriteStringFast(g.ToString());
else
WriteBytes(g.ToByteArray());
}
private void WriteBytes(byte[] bytes)
{
#if !SILVERLIGHT
WriteStringFast(Convert.ToBase64String(bytes, 0, bytes.Length, Base64FormattingOptions.None));
#else
WriteStringFast(Convert.ToBase64String(bytes, 0, bytes.Length));
#endif
}
private void WriteDateTime(DateTime dateTime)
{
// datetime format standard : yyyy-MM-dd HH:mm:ss
DateTime dt = dateTime;
if (JSON.Instance.UseUTCDateTime)
dt = dateTime.ToUniversalTime();
_output.Append("\"");
_output.Append(dt.Year.ToString("0000", NumberFormatInfo.InvariantInfo));
_output.Append("-");
_output.Append(dt.Month.ToString("00", NumberFormatInfo.InvariantInfo));
_output.Append("-");
_output.Append(dt.Day.ToString("00", NumberFormatInfo.InvariantInfo));
_output.Append(" ");
_output.Append(dt.Hour.ToString("00", NumberFormatInfo.InvariantInfo));
_output.Append(":");
_output.Append(dt.Minute.ToString("00", NumberFormatInfo.InvariantInfo));
_output.Append(":");
_output.Append(dt.Second.ToString("00", NumberFormatInfo.InvariantInfo));
_output.Append(".");
_output.Append(dt.Millisecond.ToString("000", NumberFormatInfo.InvariantInfo));
if (JSON.Instance.UseUTCDateTime)
_output.Append("Z");
_output.Append("\"");
}
#if !SILVERLIGHT
private DatasetSchema GetSchema(DataTable ds)
{
if (ds == null) return null;
DatasetSchema m = new DatasetSchema();
m.Info = new List<string>();
m.Name = ds.TableName;
foreach (DataColumn c in ds.Columns)
{
m.Info.Add(ds.TableName);
m.Info.Add(c.ColumnName);
m.Info.Add(c.DataType.ToString());
}
// TODO : serialize relations and constraints here
return m;
}
private DatasetSchema GetSchema(DataSet ds)
{
if (ds == null) return null;
DatasetSchema m = new DatasetSchema();
m.Info = new List<string>();
m.Name = ds.DataSetName;
foreach (DataTable t in ds.Tables)
{
foreach (DataColumn c in t.Columns)
{
m.Info.Add(t.TableName);
m.Info.Add(c.ColumnName);
m.Info.Add(c.DataType.ToString());
}
}
// TODO : serialize relations and constraints here
return m;
}
private string GetXmlSchema(DataTable dt)
{
using (var writer = new StringWriter())
{
dt.WriteXmlSchema(writer);
return dt.ToString();
}
}
private void WriteDataset(DataSet ds)
{
_output.Append('{');
if (useExtension)
{
WritePair("$schema", useMinimalDataSetSchema ? (object)GetSchema(ds) : ds.GetXmlSchema());
_output.Append(',');
}
bool tablesep = false;
foreach (DataTable table in ds.Tables)
{
if (tablesep) _output.Append(",");
tablesep = true;
WriteDataTableData(table);
}
// end dataset
_output.Append('}');
}
private void WriteDataTableData(DataTable table)
{
_output.Append('\"');
_output.Append(table.TableName);
_output.Append("\":[");
DataColumnCollection cols = table.Columns;
bool rowseparator = false;
foreach (DataRow row in table.Rows)
{
if (rowseparator) _output.Append(",");
rowseparator = true;
_output.Append('[');
bool pendingSeperator = false;
foreach (DataColumn column in cols)
{
if (pendingSeperator) _output.Append(',');
WriteValue(row[column]);
pendingSeperator = true;
}
_output.Append(']');
}
_output.Append(']');
}
void WriteDataTable(DataTable dt)
{
_output.Append('{');
if (useExtension)
{
WritePair("$schema", useMinimalDataSetSchema ? (object)GetSchema(dt) : GetXmlSchema(dt));
_output.Append(',');
}
WriteDataTableData(dt);
// end datatable
_output.Append('}');
}
#endif
bool _firstWritten;
private void WriteObject(object obj)
{
Indent();
if (_useGlobalTypes == false)
_output.Append('{');
else
{
if (_firstWritten)
_output.Append("{");
}
_firstWritten = true;
_current_depth++;
if (_current_depth > _MAX_DEPTH)
throw new Exception("Serializer encountered maximum depth of " + _MAX_DEPTH);
var map = new Dictionary<string, string>();
Type t = obj.GetType();
bool append = false;
if (useExtension)
{
if (_useGlobalTypes == false)
WritePairFast("$type", JSON.Instance.GetTypeAssemblyName(t));
else
{
int dt = 0;
string ct = JSON.Instance.GetTypeAssemblyName(t);
if (_globalTypes.TryGetValue(ct, out dt) == false)
{
dt = _globalTypes.Count + 1;
_globalTypes.Add(ct, dt);
}
WritePairFast("$type", dt.ToString());
}
append = true;
}
var g = JSON.Instance.GetGetters(t);
foreach (var p in g)
{
if (append)
_output.Append(',');
object o = p.Getter(obj);
if ((o == null || o is DBNull) && serializeNulls == false)
append = false;
else
{
WritePair(p.Name, o);
if (o != null && useExtension)
{
Type tt = o.GetType();
if (tt == typeof(Object))
map.Add(p.Name, tt.ToString());
}
append = true;
}
}
if (map.Count > 0 && useExtension)
{
_output.Append(",\"$map\":");
WriteStringDictionary(map);
}
_current_depth--;
Indent();
_output.Append('}');
_current_depth--;
}
private void Indent()
{
Indent(false);
}
private void Indent(bool dec)
{
if (_Indent)
{
_output.Append("\r\n");
for (int i = 0; i < _current_depth - (dec ? 1 : 0); i++)
_output.Append("\t");
}
}
private void WritePairFast(string name, string value)
{
if ((value == null) && serializeNulls == false)
return;
Indent();
WriteStringFast(name);
_output.Append(':');
WriteStringFast(value);
}
private void WritePair(string name, object value)
{
if ((value == null || value is DBNull) && serializeNulls == false)
return;
Indent();
WriteStringFast(name);
_output.Append(':');
WriteValue(value);
}
private void WriteArray(IEnumerable array)
{
Indent();
_output.Append('[');
bool pendingSeperator = false;
foreach (var obj in array)
{
Indent();
if (pendingSeperator) _output.Append(',');
WriteValue(obj);
pendingSeperator = true;
}
Indent();
_output.Append(']');
}
private void WriteStringDictionary(IDictionary dic)
{
Indent();
_output.Append('{');
bool pendingSeparator = false;
foreach (DictionaryEntry entry in dic)
{
if (pendingSeparator) _output.Append(',');
WritePair((string)entry.Key, entry.Value);
pendingSeparator = true;
}
Indent();
_output.Append('}');
}
private void WriteDictionary(IDictionary dic)
{
Indent();
_output.Append('[');
bool pendingSeparator = false;
foreach (DictionaryEntry entry in dic)
{
if (pendingSeparator) _output.Append(',');
Indent();
_output.Append('{');
WritePair("k", entry.Key);
_output.Append(",");
WritePair("v", entry.Value);
Indent();
_output.Append('}');
pendingSeparator = true;
}
Indent();
_output.Append(']');
}
private void WriteStringFast(string s)
{
//Indent();
_output.Append('\"');
_output.Append(s);
_output.Append('\"');
}
private void WriteString(string s)
{
//Indent();
_output.Append('\"');
int runIndex = -1;
for (var index = 0; index < s.Length; ++index)
{
var c = s[index];
if (c >= ' ' && c < 128 && c != '\"' && c != '\\')
{
if (runIndex == -1)
{
runIndex = index;
}
continue;
}
if (runIndex != -1)
{
_output.Append(s, runIndex, index - runIndex);
runIndex = -1;
}
switch (c)
{
case '\t': _output.Append("\\t"); break;
case '\r': _output.Append("\\r"); break;
case '\n': _output.Append("\\n"); break;
case '"':
case '\\': _output.Append('\\'); _output.Append(c); break;
default:
_output.Append("\\u");
_output.Append(((int)c).ToString("X4", NumberFormatInfo.InvariantInfo));
break;
}
}
if (runIndex != -1)
{
_output.Append(s, runIndex, s.Length - runIndex);
}
_output.Append('\"');
}
}
}

View File

@@ -1,36 +0,0 @@
//http://fastjson.codeplex.com/
//http://fastjson.codeplex.com/license
using System.Collections.Generic;
namespace LogentriesNLog.fastJSON
{
internal class SafeDictionary<TKey, TValue>
{
private readonly object _Padlock = new object();
private readonly Dictionary<TKey, TValue> _Dictionary = new Dictionary<TKey, TValue>();
internal bool TryGetValue(TKey key, out TValue value)
{
return _Dictionary.TryGetValue(key, out value);
}
internal TValue this[TKey key]
{
get
{
return _Dictionary[key];
}
}
internal void Add(TKey key, TValue value)
{
lock (_Padlock)
{
if (_Dictionary.ContainsKey(key) == false)
_Dictionary.Add(key, value);
}
}
}
}

View File

@@ -1,87 +0,0 @@
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too.
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.
Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and modification follow.
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.
You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.
c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.
In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

View File

@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NLog" version="4.3.11" targetFramework="net40" />
</packages>

View File

@@ -941,21 +941,21 @@ namespace Marr.Data
{
if (disposing)
{
if (Command.Transaction != null)
if (_command != null)
{
Command.Transaction.Dispose();
Command.Transaction = null;
}
if (_command.Transaction != null)
{
_command.Transaction.Dispose();
_command.Transaction = null;
}
if (Command.Connection != null)
{
Command.Connection.Dispose();
Command.Connection = null;
}
if (_command.Connection != null)
{
_command.Connection.Dispose();
_command.Connection = null;
}
if (Command != null)
{
Command.Dispose();
_command.Dispose();
_command = null;
}
}

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Data.Common;
@@ -91,9 +91,11 @@ namespace Marr.Data.Mapping
Type entType = ent.GetType();
if (_repos.Relationships.ContainsKey(entType))
{
var provider = _db.ProviderFactory;
var connectionString = _db.ConnectionString;
Func<IDataMapper> dbCreate = () =>
{
var db = new DataMapper(_db.ProviderFactory, _db.ConnectionString);
var db = new DataMapper(provider, connectionString);
db.SqlMode = SqlModes.Text;
return db;
};

View File

@@ -22,7 +22,7 @@ namespace Marr.Data.QGen
if (this.Any(t => t.EntityType == table.EntityType))
{
// Already exists -- don't add
return;
//return; This prevents joining on the same table!
}
// Create an alias (ex: "t0", "t1", "t2", etc...)
@@ -37,7 +37,7 @@ namespace Marr.Data.QGen
}
/// <summary>
/// Tries to find a table for a given member.
/// Tries to find a table for a given member.
/// </summary>
public Table FindTable(Type declaringType)
{

View File

@@ -96,7 +96,7 @@ namespace MonoTorrent.BEncoding
if (stream == null)
throw new ArgumentNullException("stream");
return Decode(new RawReader(stream));
return Decode(new RawReader(stream, false));
}

View File

@@ -1,9 +1,8 @@
using System;
using System;
using System.Collections.Generic;
using NzbDrone.Api.Movie;
using NzbDrone.Api.Movies;
using NzbDrone.Api.REST;
using NzbDrone.Core.Qualities;
using NzbDrone.Api.Series;
using NzbDrone.Core.Indexers;
namespace NzbDrone.Api.Blacklist
@@ -20,7 +19,6 @@ namespace NzbDrone.Api.Blacklist
public string Indexer { get; set; }
public string Message { get; set; }
public MovieResource Movie { get; set; }
public SeriesResource Series { get; set; }
}
public static class BlacklistResourceMapper
@@ -33,16 +31,13 @@ namespace NzbDrone.Api.Blacklist
{
Id = model.Id,
MovieId = model.MovieId,
SeriesId = model.SeriesId,
EpisodeIds = model.EpisodeIds,
SourceTitle = model.SourceTitle,
Quality = model.Quality,
Date = model.Date,
Protocol = model.Protocol,
Indexer = model.Indexer,
Message = model.Message,
Movie = model.Movie.ToResource(),
Series = model.Series.ToResource()
Movie = model.Movie.ToResource()
};
}
}

View File

@@ -1,13 +1,14 @@
using Nancy;
using Nancy;
using System;
using System.Collections.Generic;
using System.Linq;
using Ical.Net;
using Ical.Net.DataTypes;
using Ical.Net.General;
using Ical.Net.Interfaces.Serialization;
using Ical.Net.Serialization;
using Ical.Net.Serialization.iCalendar.Factory;
using NzbDrone.Core.Tv;
using NzbDrone.Core.Movies;
using Nancy.Responses;
using NzbDrone.Core.Tags;
using NzbDrone.Common.Extensions;
@@ -86,6 +87,10 @@ namespace NzbDrone.Api.Calendar
ProductId = "-//radarr.video//Radarr//EN"
};
var calendarName = "Radarr Movies Calendar";
calendar.AddProperty(new CalendarProperty("NAME", calendarName));
calendar.AddProperty(new CalendarProperty("X-WR-CALNAME", calendarName));
foreach (var movie in movies.OrderBy(v => v.Added))
{
if (tags.Any() && tags.None(movie.Tags.Contains))
@@ -93,42 +98,8 @@ namespace NzbDrone.Api.Calendar
continue;
}
var occurrence = calendar.Create<Event>();
occurrence.Uid = "NzbDrone_movie_" + movie.Id;
occurrence.Status = movie.HasFile ? EventStatus.Confirmed : EventStatus.Tentative;
switch (movie.Status)
{
case MovieStatusType.PreDB:
if (movie.PhysicalRelease != null)
{
occurrence.Start = new CalDateTime(movie.PhysicalRelease.Value) { HasTime = true };
occurrence.End = new CalDateTime(movie.PhysicalRelease.Value.AddMinutes(movie.Runtime)) { HasTime = true };
}
break;
case MovieStatusType.InCinemas:
if (movie.InCinemas != null)
{
occurrence.Start = new CalDateTime(movie.InCinemas.Value) { HasTime = true };
occurrence.End = new CalDateTime(movie.InCinemas.Value.AddMinutes(movie.Runtime)) { HasTime = true };
}
break;
case MovieStatusType.Announced:
continue; // no date
default:
if (movie.PhysicalRelease != null)
{
occurrence.Start = new CalDateTime(movie.PhysicalRelease.Value) { HasTime = true };
occurrence.End = new CalDateTime(movie.PhysicalRelease.Value.AddMinutes(movie.Runtime)) { HasTime = true };
}
break;
}
occurrence.Description = movie.Overview;
occurrence.Categories = new List<string>() { movie.Studio };
occurrence.Summary = $"{movie.Title}";
CreateEvent(calendar, movie, true);
CreateEvent(calendar, movie, false);
}
@@ -137,5 +108,30 @@ namespace NzbDrone.Api.Calendar
return new TextResponse(icalendar, "text/calendar");
}
private void CreateEvent(Ical.Net.Calendar calendar, Movie movie, bool cinemasRelease)
{
var date = cinemasRelease ? movie.InCinemas : movie.PhysicalRelease;
if (!date.HasValue)
{
return;
}
var occurrence = calendar.Create<Event>();
occurrence.Uid = "NzbDrone_movie_" + movie.Id + (cinemasRelease ? "_cinemas" : "_physical");
occurrence.Status = movie.Status == MovieStatusType.Announced ? EventStatus.Tentative : EventStatus.Confirmed;
occurrence.Start = new CalDateTime(date.Value);
occurrence.End = occurrence.Start;
occurrence.IsAllDay = true;
occurrence.Description = movie.Overview;
occurrence.Categories = new List<string>() { movie.Studio };
var physicalText = movie.PhysicalReleaseNote.IsNotNullOrWhiteSpace()
? $"(Physical Release, {movie.PhysicalReleaseNote})"
: "(Physical Release)";
occurrence.Summary = $"{movie.Title} " + (cinemasRelease ? "(Theatrical Release)" : physicalText);
}
}
}

View File

@@ -1,23 +1,18 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using Nancy;
using NzbDrone.Api.Episodes;
using NzbDrone.Api.Movie;
using NzbDrone.Api.Series;
using NzbDrone.Api.Movies;
using NzbDrone.Core.Datastore.Events;
using NzbDrone.Core.MediaCover;
using NzbDrone.Core.MediaFiles;
using NzbDrone.Core.MediaFiles.Events;
using NzbDrone.Core.Messaging.Events;
using NzbDrone.Core.MovieStats;
using NzbDrone.Core.Tv;
using NzbDrone.Core.Tv.Events;
using NzbDrone.Core.Movies;
using NzbDrone.Core.Movies.Events;
using NzbDrone.Core.Validation.Paths;
using NzbDrone.Core.DataAugmentation.Scene;
using NzbDrone.Core.Validation;
using NzbDrone.Core.DecisionEngine;
using NzbDrone.Core.Tv;
using NzbDrone.SignalR;
namespace NzbDrone.Api.Calendar
@@ -26,10 +21,8 @@ namespace NzbDrone.Api.Calendar
{
public CalendarModule(IBroadcastSignalRMessage signalR,
IMovieService moviesService,
IMovieStatisticsService moviesStatisticsService,
ISceneMappingService sceneMappingService,
IMapCoversToLocal coverMapper)
: base(signalR, moviesService, moviesStatisticsService, sceneMappingService, coverMapper, "calendar")
: base(signalR, moviesService, coverMapper, "calendar")
{
GetResourceAll = GetCalendar;

View File

@@ -7,6 +7,7 @@ using NzbDrone.Common.EnsureThat;
using NzbDrone.Common.Extensions;
using NzbDrone.Common.Reflection;
using NzbDrone.Core.Annotations;
using NzbDrone.Core.Download.Clients.Nzbget;
using NzbDrone.Core.Qualities;
using NzbDrone.Core.Profiles;
@@ -41,6 +42,16 @@ namespace NzbDrone.Api.ClientSchema
};
var value = propertyInfo.GetValue(model, null);
if (propertyInfo.PropertyType.HasAttribute<FlagsAttribute>())
{
int intVal = (int)value;
value = Enum.GetValues(propertyInfo.PropertyType)
.Cast<int>()
.Where(f=> (f & intVal) == f)
.ToList();
}
if (value != null)
{
field.Value = value;
@@ -102,14 +113,14 @@ namespace NzbDrone.Api.ClientSchema
{
IEnumerable<int> value;
if (field.Value.GetType() == typeof(JArray))
if (field.Value?.GetType() == typeof(JArray))
{
value = ((JArray)field.Value).Select(s => s.Value<int>());
}
else
{
value = field.Value.ToString().Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries).Select(s => Convert.ToInt32(s));
value = field.Value?.ToString().Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries).Select(s => Convert.ToInt32(s));
}
propertyInfo.SetValue(target, value, null);
@@ -132,6 +143,12 @@ namespace NzbDrone.Api.ClientSchema
propertyInfo.SetValue(target, value, null);
}
else if (propertyInfo.PropertyType.HasAttribute<FlagsAttribute>())
{
int value = field.Value.ToString().Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries).Select(s => Convert.ToInt32(s)).Sum();
propertyInfo.SetValue(target, value, null);
}
else
{
propertyInfo.SetValue(target, field.Value, null);
@@ -165,6 +182,11 @@ namespace NzbDrone.Api.ClientSchema
var options = from Enum e in Enum.GetValues(selectOptions)
select new SelectOption { Value = Convert.ToInt32(e), Name = e.ToString() };
if (selectOptions == typeof(NzbgetPriority))
{
return options.OrderBy(o => o.Value).ToList();
}
return options.OrderBy(o => o.Name).ToList();
}
}

View File

@@ -1,4 +1,4 @@
using NzbDrone.Api.REST;
using NzbDrone.Api.REST;
using NzbDrone.Core.Configuration;
namespace NzbDrone.Api.Config
@@ -11,6 +11,7 @@ namespace NzbDrone.Api.Config
public bool EnableCompletedDownloadHandling { get; set; }
public bool RemoveCompletedDownloads { get; set; }
public int CheckForFinishedDownloadInterval { get; set; }
public bool AutoRedownloadFailed { get; set; }
public bool RemoveFailedDownloads { get; set; }
@@ -28,6 +29,7 @@ namespace NzbDrone.Api.Config
EnableCompletedDownloadHandling = model.EnableCompletedDownloadHandling,
RemoveCompletedDownloads = model.RemoveCompletedDownloads,
CheckForFinishedDownloadInterval = model.CheckForFinishedDownloadInterval,
AutoRedownloadFailed = model.AutoRedownloadFailed,
RemoveFailedDownloads = model.RemoveFailedDownloads

View File

@@ -1,4 +1,4 @@
using FluentValidation;
using FluentValidation;
using NzbDrone.Api.Validation;
using NzbDrone.Core.Configuration;
@@ -13,6 +13,9 @@ namespace NzbDrone.Api.Config
SharedValidator.RuleFor(c => c.MinimumAge)
.GreaterThanOrEqualTo(0);
SharedValidator.RuleFor(c => c.MaximumSize)
.GreaterThanOrEqualTo(0);
SharedValidator.RuleFor(c => c.Retention)
.GreaterThanOrEqualTo(0);
@@ -25,4 +28,4 @@ namespace NzbDrone.Api.Config
return IndexerConfigResourceMapper.ToResource(model);
}
}
}
}

View File

@@ -1,4 +1,4 @@
using NzbDrone.Api.REST;
using NzbDrone.Api.REST;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Parser;
@@ -7,6 +7,7 @@ namespace NzbDrone.Api.Config
public class IndexerConfigResource : RestResource
{
public int MinimumAge { get; set; }
public int MaximumSize { get; set; }
public int Retention { get; set; }
public int RssSyncInterval { get; set; }
public bool PreferIndexerFlags { get; set; }
@@ -23,6 +24,7 @@ namespace NzbDrone.Api.Config
return new IndexerConfigResource
{
MinimumAge = model.MinimumAge,
MaximumSize = model.MaximumSize,
Retention = model.Retention,
RssSyncInterval = model.RssSyncInterval,
PreferIndexerFlags = model.PreferIndexerFlags,

View File

@@ -1,4 +1,4 @@
using NzbDrone.Api.REST;
using NzbDrone.Api.REST;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.MediaFiles;
@@ -22,6 +22,7 @@ namespace NzbDrone.Api.Config
public bool SkipFreeSpaceCheckWhenImporting { get; set; }
public bool CopyUsingHardlinks { get; set; }
public bool ImportExtraFiles { get; set; }
public string ExtraFileExtensions { get; set; }
public bool EnableMediaInfo { get; set; }
}
@@ -48,6 +49,7 @@ namespace NzbDrone.Api.Config
SkipFreeSpaceCheckWhenImporting = model.SkipFreeSpaceCheckWhenImporting,
CopyUsingHardlinks = model.CopyUsingHardlinks,
ImportExtraFiles = model.ImportExtraFiles,
ExtraFileExtensions = model.ExtraFileExtensions,
EnableMediaInfo = model.EnableMediaInfo
};

View File

@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using FluentValidation;
using FluentValidation.Results;
@@ -34,11 +34,6 @@ namespace NzbDrone.Api.Config
Get["/samples"] = x => GetExamples(this.Bind<NamingConfigResource>());
SharedValidator.RuleFor(c => c.MultiEpisodeStyle).InclusiveBetween(0, 5);
/*SharedValidator.RuleFor(c => c.StandardEpisodeFormat).ValidEpisodeFormat();
SharedValidator.RuleFor(c => c.DailyEpisodeFormat).ValidDailyEpisodeFormat();
SharedValidator.RuleFor(c => c.AnimeEpisodeFormat).ValidAnimeEpisodeFormat();
SharedValidator.RuleFor(c => c.SeriesFolderFormat).ValidSeriesFolderFormat();
SharedValidator.RuleFor(c => c.SeasonFolderFormat).ValidSeasonFolderFormat();*/
SharedValidator.RuleFor(c => c.StandardMovieFormat).ValidMovieFormat();
SharedValidator.RuleFor(c => c.MovieFolderFormat).ValidMovieFolderFormat();
}
@@ -56,12 +51,6 @@ namespace NzbDrone.Api.Config
var nameSpec = _namingConfigService.GetConfig();
var resource = nameSpec.ToResource();
//if (resource.StandardEpisodeFormat.IsNotNullOrWhiteSpace())
//{
// var basicConfig = _filenameBuilder.GetBasicNamingConfig(nameSpec);
// basicConfig.AddToResource(resource);
//}
if (resource.StandardMovieFormat.IsNotNullOrWhiteSpace())
{
var basicConfig = _filenameBuilder.GetBasicNamingConfig(nameSpec);
@@ -80,48 +69,13 @@ namespace NzbDrone.Api.Config
{
var nameSpec = config.ToModel();
var sampleResource = new NamingSampleResource();
//var singleEpisodeSampleResult = _filenameSampleService.GetStandardSample(nameSpec);
//var multiEpisodeSampleResult = _filenameSampleService.GetMultiEpisodeSample(nameSpec);
//var dailyEpisodeSampleResult = _filenameSampleService.GetDailySample(nameSpec);
//var animeEpisodeSampleResult = _filenameSampleService.GetAnimeSample(nameSpec);
//var animeMultiEpisodeSampleResult = _filenameSampleService.GetAnimeMultiEpisodeSample(nameSpec);
var movieSampleResult = _filenameSampleService.GetMovieSample(nameSpec);
//sampleResource.SingleEpisodeExample = _filenameValidationService.ValidateStandardFilename(singleEpisodeSampleResult) != null
// ? "Invalid format"
// : singleEpisodeSampleResult.FileName;
//sampleResource.MultiEpisodeExample = _filenameValidationService.ValidateStandardFilename(multiEpisodeSampleResult) != null
// ? "Invalid format"
// : multiEpisodeSampleResult.FileName;
//sampleResource.DailyEpisodeExample = _filenameValidationService.ValidateDailyFilename(dailyEpisodeSampleResult) != null
// ? "Invalid format"
// : dailyEpisodeSampleResult.FileName;
//sampleResource.AnimeEpisodeExample = _filenameValidationService.ValidateAnimeFilename(animeEpisodeSampleResult) != null
// ? "Invalid format"
// : animeEpisodeSampleResult.FileName;
//sampleResource.AnimeMultiEpisodeExample = _filenameValidationService.ValidateAnimeFilename(animeMultiEpisodeSampleResult) != null
// ? "Invalid format"
// : animeMultiEpisodeSampleResult.FileName;
sampleResource.MovieExample = nameSpec.StandardMovieFormat.IsNullOrWhiteSpace()
? "Invalid Format"
: movieSampleResult.FileName;
//sampleResource.SeriesFolderExample = nameSpec.SeriesFolderFormat.IsNullOrWhiteSpace()
// ? "Invalid format"
// : _filenameSampleService.GetSeriesFolderSample(nameSpec);
//sampleResource.SeasonFolderExample = nameSpec.SeasonFolderFormat.IsNullOrWhiteSpace()
// ? "Invalid format"
// : _filenameSampleService.GetSeasonFolderSample(nameSpec);
sampleResource.MovieFolderExample = nameSpec.MovieFolderFormat.IsNullOrWhiteSpace()
? "Invalid format"
: _filenameSampleService.GetMovieFolderSample(nameSpec);
@@ -131,30 +85,12 @@ namespace NzbDrone.Api.Config
private void ValidateFormatResult(NamingConfig nameSpec)
{
var singleEpisodeSampleResult = _filenameSampleService.GetStandardSample(nameSpec);
var multiEpisodeSampleResult = _filenameSampleService.GetMultiEpisodeSample(nameSpec);
var dailyEpisodeSampleResult = _filenameSampleService.GetDailySample(nameSpec);
var animeEpisodeSampleResult = _filenameSampleService.GetAnimeSample(nameSpec);
var animeMultiEpisodeSampleResult = _filenameSampleService.GetAnimeMultiEpisodeSample(nameSpec);
var movieSampleResult = _filenameSampleService.GetMovieSample(nameSpec);
var singleEpisodeValidationResult = _filenameValidationService.ValidateStandardFilename(singleEpisodeSampleResult);
var multiEpisodeValidationResult = _filenameValidationService.ValidateStandardFilename(multiEpisodeSampleResult);
var dailyEpisodeValidationResult = _filenameValidationService.ValidateDailyFilename(dailyEpisodeSampleResult);
var animeEpisodeValidationResult = _filenameValidationService.ValidateAnimeFilename(animeEpisodeSampleResult);
var animeMultiEpisodeValidationResult = _filenameValidationService.ValidateAnimeFilename(animeMultiEpisodeSampleResult);
//var standardMovieValidationResult = _filenameValidationService.ValidateMovieFilename(movieSampleResult); For now, let's hope the user is not stupid enough :/
var validationFailures = new List<ValidationFailure>();
//validationFailures.AddIfNotNull(singleEpisodeValidationResult);
//validationFailures.AddIfNotNull(multiEpisodeValidationResult);
//validationFailures.AddIfNotNull(dailyEpisodeValidationResult);
//validationFailures.AddIfNotNull(animeEpisodeValidationResult);
//validationFailures.AddIfNotNull(animeMultiEpisodeValidationResult);
//validationFailures.AddIfNotNull(standardMovieValidationResult);
if (validationFailures.Any())

View File

@@ -1,4 +1,4 @@
using NzbDrone.Api.REST;
using NzbDrone.Api.REST;
using NzbDrone.Core.Organizer;
namespace NzbDrone.Api.Config
@@ -7,14 +7,10 @@ namespace NzbDrone.Api.Config
{
public bool RenameEpisodes { get; set; }
public bool ReplaceIllegalCharacters { get; set; }
public ColonReplacementFormat ColonReplacementFormat { get; set; }
public string StandardMovieFormat { get; set; }
public string MovieFolderFormat { get; set; }
public int MultiEpisodeStyle { get; set; }
public string StandardEpisodeFormat { get; set; }
public string DailyEpisodeFormat { get; set; }
public string AnimeEpisodeFormat { get; set; }
public string SeriesFolderFormat { get; set; }
public string SeasonFolderFormat { get; set; }
public bool IncludeSeriesTitle { get; set; }
public bool IncludeEpisodeTitle { get; set; }
public bool IncludeQuality { get; set; }
@@ -33,12 +29,8 @@ namespace NzbDrone.Api.Config
RenameEpisodes = model.RenameEpisodes,
ReplaceIllegalCharacters = model.ReplaceIllegalCharacters,
ColonReplacementFormat = model.ColonReplacementFormat,
MultiEpisodeStyle = model.MultiEpisodeStyle,
StandardEpisodeFormat = model.StandardEpisodeFormat,
DailyEpisodeFormat = model.DailyEpisodeFormat,
AnimeEpisodeFormat = model.AnimeEpisodeFormat,
SeriesFolderFormat = model.SeriesFolderFormat,
SeasonFolderFormat = model.SeasonFolderFormat,
StandardMovieFormat = model.StandardMovieFormat,
MovieFolderFormat = model.MovieFolderFormat
//IncludeSeriesTitle
@@ -68,15 +60,10 @@ namespace NzbDrone.Api.Config
RenameEpisodes = resource.RenameEpisodes,
ReplaceIllegalCharacters = resource.ReplaceIllegalCharacters,
//MultiEpisodeStyle = resource.MultiEpisodeStyle,
//StandardEpisodeFormat = resource.StandardEpisodeFormat,
//DailyEpisodeFormat = resource.DailyEpisodeFormat,
//AnimeEpisodeFormat = resource.AnimeEpisodeFormat,
//SeriesFolderFormat = resource.SeriesFolderFormat,
//SeasonFolderFormat = resource.SeasonFolderFormat,
ColonReplacementFormat = resource.ColonReplacementFormat,
StandardMovieFormat = resource.StandardMovieFormat,
MovieFolderFormat = resource.MovieFolderFormat
};
}
}
}
}

View File

@@ -1,88 +0,0 @@
using System.Collections.Generic;
using System.IO;
using NLog;
using NzbDrone.Api.REST;
using NzbDrone.Core.Datastore.Events;
using NzbDrone.Core.MediaFiles;
using NzbDrone.Core.MediaFiles.Events;
using NzbDrone.Core.Messaging.Events;
using NzbDrone.Core.Tv;
using NzbDrone.Core.DecisionEngine;
using NzbDrone.SignalR;
namespace NzbDrone.Api.EpisodeFiles
{
public class EpisodeFileModule : NzbDroneRestModuleWithSignalR<EpisodeFileResource, EpisodeFile>,
IHandle<EpisodeFileAddedEvent>
{
private readonly IMediaFileService _mediaFileService;
private readonly IRecycleBinProvider _recycleBinProvider;
private readonly ISeriesService _seriesService;
private readonly IQualityUpgradableSpecification _qualityUpgradableSpecification;
private readonly Logger _logger;
public EpisodeFileModule(IBroadcastSignalRMessage signalRBroadcaster,
IMediaFileService mediaFileService,
IRecycleBinProvider recycleBinProvider,
ISeriesService seriesService,
IQualityUpgradableSpecification qualityUpgradableSpecification,
Logger logger)
: base(signalRBroadcaster)
{
_mediaFileService = mediaFileService;
_recycleBinProvider = recycleBinProvider;
_seriesService = seriesService;
_qualityUpgradableSpecification = qualityUpgradableSpecification;
_logger = logger;
GetResourceById = GetEpisodeFile;
GetResourceAll = GetEpisodeFiles;
UpdateResource = SetQuality;
DeleteResource = DeleteEpisodeFile;
}
private EpisodeFileResource GetEpisodeFile(int id)
{
var episodeFile = _mediaFileService.Get(id);
var series = _seriesService.GetSeries(episodeFile.SeriesId);
return episodeFile.ToResource(series, _qualityUpgradableSpecification);
}
private List<EpisodeFileResource> GetEpisodeFiles()
{
if (!Request.Query.SeriesId.HasValue)
{
throw new BadRequestException("seriesId is missing");
}
var seriesId = (int)Request.Query.SeriesId;
var series = _seriesService.GetSeries(seriesId);
return _mediaFileService.GetFilesBySeries(seriesId).ConvertAll(f => f.ToResource(series, _qualityUpgradableSpecification));
}
private void SetQuality(EpisodeFileResource episodeFileResource)
{
var episodeFile = _mediaFileService.Get(episodeFileResource.Id);
episodeFile.Quality = episodeFileResource.Quality;
_mediaFileService.Update(episodeFile);
}
private void DeleteEpisodeFile(int id)
{
var episodeFile = _mediaFileService.Get(id);
var series = _seriesService.GetSeries(episodeFile.SeriesId);
var fullPath = Path.Combine(series.Path, episodeFile.RelativePath);
_logger.Info("Deleting episode file: {0}", fullPath);
_recycleBinProvider.DeleteFile(fullPath);
_mediaFileService.Delete(episodeFile, DeleteMediaFileReason.Manual);
}
public void Handle(EpisodeFileAddedEvent message)
{
BroadcastResourceChange(ModelAction.Updated, message.EpisodeFile.Id);
}
}
}

View File

@@ -1,64 +0,0 @@
using System;
using System.IO;
using NzbDrone.Api.REST;
using NzbDrone.Core.Qualities;
namespace NzbDrone.Api.EpisodeFiles
{
public class EpisodeFileResource : RestResource
{
public int SeriesId { get; set; }
public int SeasonNumber { get; set; }
public string RelativePath { get; set; }
public string Path { get; set; }
public long Size { get; set; }
public DateTime DateAdded { get; set; }
public string SceneName { get; set; }
public QualityModel Quality { get; set; }
public bool QualityCutoffNotMet { get; set; }
}
public static class EpisodeFileResourceMapper
{
private static EpisodeFileResource ToResource(this Core.MediaFiles.EpisodeFile model)
{
if (model == null) return null;
return new EpisodeFileResource
{
Id = model.Id,
SeriesId = model.SeriesId,
SeasonNumber = model.SeasonNumber,
RelativePath = model.RelativePath,
//Path
Size = model.Size,
DateAdded = model.DateAdded,
SceneName = model.SceneName,
Quality = model.Quality,
//QualityCutoffNotMet
};
}
public static EpisodeFileResource ToResource(this Core.MediaFiles.EpisodeFile model, Core.Tv.Series series, Core.DecisionEngine.IQualityUpgradableSpecification qualityUpgradableSpecification)
{
if (model == null) return null;
return new EpisodeFileResource
{
Id = model.Id,
SeriesId = model.SeriesId,
SeasonNumber = model.SeasonNumber,
RelativePath = model.RelativePath,
Path = Path.Combine(series.Path, model.RelativePath),
Size = model.Size,
DateAdded = model.DateAdded,
SceneName = model.SceneName,
Quality = model.Quality,
QualityCutoffNotMet = qualityUpgradableSpecification.CutoffNotMet(series.Profile.Value, model.Quality)
};
}
}
}

View File

@@ -1,41 +0,0 @@
using System.Collections.Generic;
using NzbDrone.Api.REST;
using NzbDrone.Core.Tv;
using NzbDrone.Core.DecisionEngine;
using NzbDrone.SignalR;
using Nancy;
namespace NzbDrone.Api.Episodes
{
public class EpisodeModule : EpisodeModuleWithSignalR
{
public EpisodeModule(ISeriesService seriesService,
IEpisodeService episodeService,
IQualityUpgradableSpecification qualityUpgradableSpecification,
IBroadcastSignalRMessage signalRBroadcaster)
: base(episodeService, seriesService, qualityUpgradableSpecification, signalRBroadcaster)
{
GetResourceAll = GetEpisodes;
UpdateResource = SetMonitored;
}
private List<EpisodeResource> GetEpisodes()
{
if (!Request.Query.SeriesId.HasValue)
{
throw new BadRequestException("seriesId is missing");
}
var seriesId = (int)Request.Query.SeriesId;
var resources = MapToResource(_episodeService.GetEpisodeBySeries(seriesId), false, true);
return resources;
}
private void SetMonitored(EpisodeResource episodeResource)
{
_episodeService.SetEpisodeMonitored(episodeResource.Id, episodeResource.Monitored);
}
}
}

View File

@@ -1,126 +0,0 @@
using System.Collections.Generic;
using NzbDrone.Common.Extensions;
using NzbDrone.Api.EpisodeFiles;
using NzbDrone.Api.Series;
using NzbDrone.Core.Datastore.Events;
using NzbDrone.Core.DecisionEngine;
using NzbDrone.Core.Download;
using NzbDrone.Core.MediaFiles.Events;
using NzbDrone.Core.Messaging.Events;
using NzbDrone.Core.Tv;
using NzbDrone.SignalR;
namespace NzbDrone.Api.Episodes
{
public abstract class EpisodeModuleWithSignalR : NzbDroneRestModuleWithSignalR<EpisodeResource, Episode>,
IHandle<EpisodeGrabbedEvent>,
IHandle<EpisodeDownloadedEvent>
{
protected readonly IEpisodeService _episodeService;
protected readonly ISeriesService _seriesService;
protected readonly IQualityUpgradableSpecification _qualityUpgradableSpecification;
protected EpisodeModuleWithSignalR(IEpisodeService episodeService,
ISeriesService seriesService,
IQualityUpgradableSpecification qualityUpgradableSpecification,
IBroadcastSignalRMessage signalRBroadcaster)
: base(signalRBroadcaster)
{
_episodeService = episodeService;
_seriesService = seriesService;
_qualityUpgradableSpecification = qualityUpgradableSpecification;
GetResourceById = GetEpisode;
}
protected EpisodeModuleWithSignalR(IEpisodeService episodeService,
ISeriesService seriesService,
IQualityUpgradableSpecification qualityUpgradableSpecification,
IBroadcastSignalRMessage signalRBroadcaster,
string resource)
: base(signalRBroadcaster, resource)
{
_episodeService = episodeService;
_seriesService = seriesService;
_qualityUpgradableSpecification = qualityUpgradableSpecification;
GetResourceById = GetEpisode;
}
protected EpisodeResource GetEpisode(int id)
{
var episode = _episodeService.GetEpisode(id);
var resource = MapToResource(episode, true, true);
return resource;
}
protected EpisodeResource MapToResource(Episode episode, bool includeSeries, bool includeEpisodeFile)
{
var resource = episode.ToResource();
if (includeSeries || includeEpisodeFile)
{
var series = episode.Series ?? _seriesService.GetSeries(episode.SeriesId);
if (includeSeries)
{
resource.Series = series.ToResource();
}
if (includeEpisodeFile && episode.EpisodeFileId != 0)
{
resource.EpisodeFile = episode.EpisodeFile.Value.ToResource(series, _qualityUpgradableSpecification);
}
}
return resource;
}
protected List<EpisodeResource> MapToResource(List<Episode> episodes, bool includeSeries, bool includeEpisodeFile)
{
var result = episodes.ToResource();
if (includeSeries || includeEpisodeFile)
{
var seriesDict = new Dictionary<int, Core.Tv.Series>();
for (var i = 0; i < episodes.Count; i++)
{
var episode = episodes[i];
var resource = result[i];
var series = episode.Series ?? seriesDict.GetValueOrDefault(episodes[i].SeriesId) ?? _seriesService.GetSeries(episodes[i].SeriesId);
seriesDict[series.Id] = series;
if (includeSeries)
{
resource.Series = series.ToResource();
}
if (includeEpisodeFile && episodes[i].EpisodeFileId != 0)
{
resource.EpisodeFile = episodes[i].EpisodeFile.Value.ToResource(series, _qualityUpgradableSpecification);
}
}
}
return result;
}
public void Handle(EpisodeGrabbedEvent message)
{
foreach (var episode in message.Episode.Episodes)
{
var resource = episode.ToResource();
resource.Grabbed = true;
BroadcastResourceChange(ModelAction.Updated, resource);
}
}
public void Handle(EpisodeDownloadedEvent message)
{
foreach (var episode in message.Episode.Episodes)
{
BroadcastResourceChange(ModelAction.Updated, episode.Id);
}
}
}
}

View File

@@ -1,78 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Newtonsoft.Json;
using NzbDrone.Api.EpisodeFiles;
using NzbDrone.Api.REST;
using NzbDrone.Api.Series;
using NzbDrone.Core.Tv;
namespace NzbDrone.Api.Episodes
{
public class EpisodeResource : RestResource
{
public int SeriesId { get; set; }
public int EpisodeFileId { get; set; }
public int SeasonNumber { get; set; }
public int EpisodeNumber { get; set; }
public string Title { get; set; }
public string AirDate { get; set; }
public DateTime? AirDateUtc { get; set; }
public string Overview { get; set; }
public EpisodeFileResource EpisodeFile { get; set; }
public bool HasFile { get; set; }
public bool Monitored { get; set; }
public int? AbsoluteEpisodeNumber { get; set; }
public int? SceneAbsoluteEpisodeNumber { get; set; }
public int? SceneEpisodeNumber { get; set; }
public int? SceneSeasonNumber { get; set; }
public bool UnverifiedSceneNumbering { get; set; }
public string SeriesTitle { get; set; }
public SeriesResource Series { get; set; }
//Hiding this so people don't think its usable (only used to set the initial state)
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
public bool Grabbed { get; set; }
}
public static class EpisodeResourceMapper
{
public static EpisodeResource ToResource(this Episode model)
{
if (model == null) return null;
return new EpisodeResource
{
Id = model.Id,
SeriesId = model.SeriesId,
EpisodeFileId = model.EpisodeFileId,
SeasonNumber = model.SeasonNumber,
EpisodeNumber = model.EpisodeNumber,
Title = model.Title,
AirDate = model.AirDate,
AirDateUtc = model.AirDateUtc,
Overview = model.Overview,
//EpisodeFile
HasFile = model.HasFile,
Monitored = model.Monitored,
AbsoluteEpisodeNumber = model.AbsoluteEpisodeNumber,
SceneAbsoluteEpisodeNumber = model.SceneAbsoluteEpisodeNumber,
SceneEpisodeNumber = model.SceneEpisodeNumber,
SceneSeasonNumber = model.SceneSeasonNumber,
UnverifiedSceneNumbering = model.UnverifiedSceneNumbering,
SeriesTitle = model.SeriesTitle,
//Series = model.Series.MapToResource(),
};
}
public static List<EpisodeResource> ToResource(this IEnumerable<Episode> models)
{
if (models == null) return null;
return models.Select(ToResource).ToList();
}
}
}

View File

@@ -1,37 +0,0 @@
using System.Collections.Generic;
using NzbDrone.Api.REST;
using NzbDrone.Core.MediaFiles;
namespace NzbDrone.Api.Episodes
{
public class RenameEpisodeModule : NzbDroneRestModule<RenameEpisodeResource>
{
private readonly IRenameEpisodeFileService _renameEpisodeFileService;
public RenameEpisodeModule(IRenameEpisodeFileService renameEpisodeFileService)
: base("rename")
{
_renameEpisodeFileService = renameEpisodeFileService;
GetResourceAll = GetEpisodes;
}
private List<RenameEpisodeResource> GetEpisodes()
{
if (!Request.Query.SeriesId.HasValue)
{
throw new BadRequestException("seriesId is missing");
}
var seriesId = (int)Request.Query.SeriesId;
if (Request.Query.SeasonNumber.HasValue)
{
var seasonNumber = (int)Request.Query.SeasonNumber;
return _renameEpisodeFileService.GetRenamePreviews(seriesId, seasonNumber).ToResource();
}
return _renameEpisodeFileService.GetRenamePreviews(seriesId).ToResource();
}
}
}

View File

@@ -1,39 +0,0 @@
using System.Collections.Generic;
using System.Linq;
using NzbDrone.Api.REST;
namespace NzbDrone.Api.Episodes
{
public class RenameEpisodeResource : RestResource
{
public int SeriesId { get; set; }
public int SeasonNumber { get; set; }
public List<int> EpisodeNumbers { get; set; }
public int EpisodeFileId { get; set; }
public string ExistingPath { get; set; }
public string NewPath { get; set; }
}
public static class RenameEpisodeResourceMapper
{
public static RenameEpisodeResource ToResource(this Core.MediaFiles.RenameEpisodeFilePreview model)
{
if (model == null) return null;
return new RenameEpisodeResource
{
SeriesId = model.SeriesId,
SeasonNumber = model.SeasonNumber,
EpisodeNumbers = model.EpisodeNumbers.ToList(),
EpisodeFileId = model.EpisodeFileId,
ExistingPath = model.ExistingPath,
NewPath = model.NewPath
};
}
public static List<RenameEpisodeResource> ToResource(this IEnumerable<Core.MediaFiles.RenameEpisodeFilePreview> models)
{
return models.Select(ToResource).ToList();
}
}
}

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