Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cc-5709: Airtime Analyzer #57

Open
wants to merge 389 commits into
base: 2.5.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 67 commits
Commits
Show all changes
389 commits
Select commit Hold shift + click to select a range
1009719
Merge branch 'cc-5709-airtime-analyzer' of github.com:sourcefabric/Ai…
drigato Apr 25, 2014
a43f487
Fixed airtime-upgrade.php...
Apr 25, 2014
f432ea9
CC-5802: Upgrade application.ini file
drigato Apr 25, 2014
5873f7b
Merge branch 'cc-5709-airtime-analyzer' of github.com:sourcefabric/Ai…
drigato Apr 25, 2014
61df7c1
Moved some comments around
drigato Apr 25, 2014
66000a2
CC-5802: Upgrade application.ini file
drigato Apr 25, 2014
8d9b9c1
Moved deleting the maintenace temporary file flag to very end of upgr…
drigato Apr 25, 2014
42806b1
CC-5802: Upgrade application.ini file
drigato Apr 28, 2014
d081ff1
CC-5807: Disk Space will be updated when file is not actually deleted
drigato Apr 28, 2014
375ec54
CC-5820: Airtime Analyzer: Length and MIME parsing skipped if file has
Apr 28, 2014
fae5b15
CC-5821: Airtime Analyzer: Ftp-uploaded folder doesn't get removed fr…
drigato Apr 28, 2014
f9f9e24
Merge branch 'cc-5709-airtime-analyzer' of github.com:sourcefabric/Ai…
drigato Apr 28, 2014
c586e3e
CC-5821: Airtime Analyzer: Ftp-uploaded folder doesn't get removed fr…
drigato Apr 28, 2014
f428a2d
CC-5821: Airtime Analyzer: Ftp-uploaded folder doesn't get removed fr…
drigato Apr 28, 2014
7968749
Logging statement. To remove later.
drigato Apr 28, 2014
6f1dd79
CC-5821: Airtime Analyzer: Ftp-uploaded folder doesn't get removed fr…
drigato Apr 29, 2014
94375ee
CC-5821: Airtime Analyzer: Ftp-uploaded folder doesn't get removed fr…
drigato Apr 29, 2014
04da9b3
CC-5821: Airtime Analyzer: Ftp-uploaded folder doesn't get removed fr…
drigato Apr 29, 2014
a5eb5e9
CC-5806: Airtime Analyzer: Please implement "remove all files"
drigato Apr 29, 2014
c2f6032
Fixed the upstart config
Apr 30, 2014
26a39ed
CC-5823: Airtime Analyzer: Wav file uploading fails with zero length and
Apr 30, 2014
ace03ed
Merge branch 'cc-5709-airtime-analyzer' of github.com:sourcefabric/Ai…
Apr 30, 2014
abcdf5e
CC-5824: Airtime Analyzer: Flac file was uploaded but AA says it's
Apr 30, 2014
c11e39f
Fixed python-magic dependency
Apr 30, 2014
721e4e1
CC-5806: Airtime Analyzer: Please implement "remove all files"
drigato May 1, 2014
9cd200d
Merge branch 'cc-5709-airtime-analyzer' of github.com:sourcefabric/Ai…
drigato May 1, 2014
2d67484
Remove database credentials from application.ini
May 2, 2014
4b4fd54
Merge branch 'cc-5709-airtime-analyzer' of github.com:sourcefabric/Ai…
May 2, 2014
5dab498
Removed this silly airtime-update-db-settings script
May 2, 2014
e4e5590
CC-5802: Upgrade application.ini file
drigato May 5, 2014
094382c
Merge branch 'cc-5709-airtime-analyzer' of github.com:sourcefabric/Ai…
drigato May 5, 2014
16fb9d7
Changed GetDiskUsage so it will always return 0 if the value has not …
drigato May 5, 2014
22343ed
Fixed bitrate import in airtime_analyzer
May 5, 2014
d063700
CC-5834: Airtime Analyzer: Bitrate is missing
May 5, 2014
ed494ac
Some defensive code against multiprocess related deadlocks
May 5, 2014
bc080a2
Merge branch '2.5.x' into cc-5709-airtime-analyzer
drigato May 6, 2014
56c3d80
Alternate bugfix for logging deadlock in airtime_analyzer
May 6, 2014
6b7170f
Merge branch 'cc-5709-airtime-analyzer' of github.com:sourcefabric/Ai…
May 6, 2014
81dd1de
Removing something for testing
drigato May 7, 2014
c291439
Adding back analyzer deadlock workaround.
drigato May 7, 2014
0040965
CC-5840: Add Media -> Endless retries if there is a validation error
drigato May 8, 2014
691841e
CC-5844: Airtime Analyzer: Auto format the 'year' tag.
drigato May 12, 2014
4cdd855
CC-5855: Output to zendlog when files are deleted from library
drigato May 20, 2014
08badfb
SAAS-436: Fix widgets
May 20, 2014
8432799
CC-5853: Tracks marked as 'hidden' won't be marked as unavailable in …
drigato May 22, 2014
091be8c
SAAS-439: Genres longer than 64 characters cause Media API exception
May 22, 2014
e1a0429
Handle error case that could cause invalid disk usage reading
May 22, 2014
9eb0f2f
CC-5859: Airtime Analyzer: format fields before writing to db
drigato May 26, 2014
d21cb59
CC-5860: Analyzer HTTP requests can hang indefinitely
May 26, 2014
7caa42c
Merge branch 'cc-5709-airtime-analyzer' of github.com:sourcefabric/Ai…
May 26, 2014
1373d49
CC-5862: Invalid UTF-8 chars cause DB error
May 30, 2014
9f9c32a
Merge branch '2.5.x' into cc-5709-airtime-analyzer
May 30, 2014
2e6d382
CC-5863: Deleted files still shown in Recent Uploads view
Jun 2, 2014
4548123
CC-5861: Long file paths will cause analyzer error
Jun 3, 2014
a969f8f
CC-5856: Analyzer metadata exception
Jun 3, 2014
5e7fdb9
Don't retry Analyzer HTTP requests if the web app is broken
Jun 4, 2014
e3c2ae0
Fixed upload file count being wrong in Add Media page (lemma to CC-5863)
Jun 4, 2014
a12ebf2
CC-5836: Status page still reports media-monitor even AA enabled
Jun 4, 2014
560d1a9
Merge branch '2.5.x' into cc-5709-airtime-analyzer
Jun 9, 2014
e5a74e7
Fix error due to bad exception throwing
Jun 11, 2014
24d842c
Merge branch '2.5.x' into cc-5709-airtime-analyzer
Jun 23, 2014
aeb3bb7
SAAS-447: Cloud Storage
drigato Jul 4, 2014
2b70417
Set resource_id and directory to 'cloud' type on PUT request
drigato Jul 4, 2014
1393bad
Modified config file variables to describe not only rabbitmq settings
drigato Jul 4, 2014
e84f765
Better FileMover permissions unit test (passes as root)
Jul 7, 2014
d2e8325
CC-5891: Install apache-libcloud under virtualenv
drigato Jul 10, 2014
c2411b6
CC-5884: Modify Pypo -> Download files from cloud storage
drigato Jul 10, 2014
e6bbf8e
CC-5884: Modify Pypo -> Download files from cloud storage
drigato Jul 10, 2014
6f119b0
CC-5884: Modify Pypo -> Download files from cloud storage
drigato Jul 10, 2014
e7dfc08
CC-5892: Handle when a file is downloaded from the Airtime library
drigato Jul 10, 2014
039a511
CC-5885: Factor out cloud storage code into separate class
drigato Jul 11, 2014
9d0f564
Prevent analyzer from crashing if it is reporting a failure to Airtime
drigato Jul 11, 2014
8e714bc
CC-5888: Handle file deletion if the file is stored in the cloud
drigato Jul 15, 2014
1aa99e2
Merge branch '2.5.x' into cc-5709-airtime-analyzer
Jul 15, 2014
7438ecd
Use track metadata from Airtime in playout engine
Jul 15, 2014
aaee522
CC-5888: Handle file deletion if the file is stored in the cloud
drigato Jul 15, 2014
7ca6b91
CC-5888: Handle file deletion if the file is stored in the cloud
drigato Jul 16, 2014
82d7f09
Small code cleanup
drigato Jul 16, 2014
3f676be
Use a different libcloud function for uploading files
drigato Jul 16, 2014
c09457c
Merge branch 'cc-5709-airtime-analyzer' into cc-5709-airtime-analyzer…
Jul 16, 2014
46542d2
Merge branch 'cc-5709-airtime-analyzer-cloud-storage' of github.com:s…
Jul 16, 2014
72841de
CC-5895: Upgrade Propel to 1.7
drigato Jul 23, 2014
9c2a086
CC-5895: Upgrade Propel to 1.7
drigato Jul 23, 2014
41ff0cc
CC-5896: Store cloud files in separate table, inherited from cc_files
drigato Jul 23, 2014
efb2a5e
CC-5895: Upgrade Propel to 1.7
drigato Jul 23, 2014
7490c81
CC-5895: Upgrade Propel to 1.7
drigato Jul 23, 2014
b38f3d7
CC-5895: Upgrade Propel to 1.7
drigato Jul 23, 2014
f1ea100
CC-5896: Store cloud files in separate table, inherited from cc_files
drigato Jul 24, 2014
ecb072b
CC-5896: Store cloud files in separate table, inherited from cc_files
drigato Jul 28, 2014
f6aa2e5
CC-5896: Store cloud files in separate table, inherited from cc_files
drigato Jul 28, 2014
6fa7ddb
CC-5896: Store cloud files in separate table, inherited from cc_files
drigato Jul 28, 2014
b7d1852
CC-5896: Store cloud files in separate table, inherited from cc_files
drigato Jul 28, 2014
8c27549
CC-5896: Store cloud files in separate table, inherited from cc_files
drigato Jul 29, 2014
dd37ffb
CC-5888: Handle file deletion if the file is stored in the cloud
drigato Aug 1, 2014
02ea553
Removed media api delete-success callback because it's no longer in use
drigato Aug 1, 2014
aa8a262
Fix zend routing on Trusty (weird error due to REST module)
Aug 1, 2014
6545828
Removed exiting pypo if error occurs during cloud storage downloads
drigato Aug 11, 2014
35c450b
Audio preview fix
drigato Aug 12, 2014
4622834
Audio preview fix
drigato Aug 12, 2014
879e776
CC-5888: Handle file deletion if the file is stored in the cloud
drigato Aug 12, 2014
ca62086
Removed cloud file deletion from Airtime Analyzer. Deletion is done f…
drigato Aug 12, 2014
9fe0830
Merge branch '2.5.x' into cc-5709-airtime-analyzer
drigato Aug 28, 2014
52f3ed8
Merge branch 'cc-5709-airtime-analyzer' of github.com:sourcefabric/Ai…
drigato Aug 28, 2014
0ccc7e7
SAAS-470: Zend Rest module doesn't work on Ubuntu 14.04
drigato Aug 28, 2014
c4692cc
Merge branch '2.5.x' into cc-5709-airtime-analyzer
drigato Oct 8, 2014
2423ea6
Merge branch 'cc-5709-airtime-analyzer' into cc-5709-airtime-analyzer…
drigato Oct 8, 2014
f439072
Merge branch '2.5.x' into cc-5709-airtime-analyzer
Oct 10, 2014
081ca0a
Reworked upstart config for airtime_analyzer
Oct 10, 2014
a10e287
Fixed a fresh install bug that wasn't using composer installs.
drigato Oct 14, 2014
544d20e
Replaced spaces with dashes in resource_id generation
drigato Oct 17, 2014
28be5c6
CC-5929: Certain long filenames can result in the extension getting c…
Oct 21, 2014
f775bed
Stopped returning filesize in delete functions.
drigato Oct 21, 2014
82f251f
Fix invalid python in StatusReporter
Oct 21, 2014
54523e2
Fix rare exception during shutdown in airtime_analyzer
Oct 22, 2014
53dc92b
StatusReporter exception handler to prevent thread from dying under a…
Oct 22, 2014
9726fb8
Removed amazon s3 signature from pypo cache file name.
drigato Oct 22, 2014
8134687
Merge branch '2.5.x' into cc-5709-airtime-analyzer
drigato Oct 22, 2014
70ff673
Merge branch 'cc-5709-airtime-analyzer' into cc-5709-airtime-analyzer…
drigato Oct 22, 2014
7edd993
Reverted pypo's copy file method to how it was without cloud files
drigato Oct 24, 2014
7018f45
Check filesize is greater than zero before deleteing a file from library
drigato Oct 27, 2014
978fc43
Started commenting CloudStorageUploader class
drigato Oct 29, 2014
01ad2ab
Commented cloud storage classes
drigato Oct 29, 2014
fd39db2
Merge pull request #75 - Saas relder csrf delete file
Oct 29, 2014
c590869
Merge branch 'cc-5709-airtime-analyzer' of github.com:sourcefabric/Ai…
Oct 29, 2014
e236491
Added comments to CcFiles and CloudFile classes.
drigato Oct 30, 2014
54d1bcf
Merge branch '2.5.x' into cc-5709-airtime-analyzer
drigato Oct 30, 2014
b871b32
Merge branch 'cc-5709-airtime-analyzer' into cc-5709-airtime-analyzer…
drigato Oct 30, 2014
52b0db5
Merge branch '2.5.x' into cc-5709-airtime-analyzer
drigato Nov 3, 2014
7e1d14f
Merge branch 'cc-5709-airtime-analyzer' into cc-5709-airtime-analyzer…
drigato Nov 3, 2014
5f98151
Removed unused route from rest Media Controller
drigato Nov 3, 2014
27b8f0a
Removed delete-success view script because action no longer exists.
drigato Nov 3, 2014
e24b4f4
Made AirtimeAnalyzerServer.read_config_file static so CloudStorageUpl…
drigato Nov 5, 2014
1dc72d5
Changed Amazon S3 download URL format so it works with S3_EU_WEST reg…
drigato Nov 7, 2014
ecc0225
Added apache-libcloud dependency to airtime_analyzer
drigato Nov 7, 2014
fa88e72
Removed composer.lock from gitignore
drigato Nov 7, 2014
c636272
composer.lock
drigato Nov 7, 2014
63b357f
Updated requirements for airtime_analyzer to make python-requests
Nov 11, 2014
eb0f12c
Change back rabbitmq config file param name
drigato Nov 10, 2014
49f3881
rmq_config_path fix
drigato Nov 10, 2014
b304e2f
Bug fix
drigato Nov 10, 2014
dbc5563
Changed print statements so they go to the pypo log
drigato Nov 11, 2014
5cf5ff4
code cleanup
drigato Nov 11, 2014
b324031
Disable those new requirements because pip requires gcc to install them
Nov 11, 2014
c132cac
Code cleanup
drigato Nov 12, 2014
95517ca
Fix exception thrown when the analyzer doesn't return filesize with t…
drigato Nov 12, 2014
f1fa492
Merge branch 'cc-5709-airtime-analyzer' into cc-5709-airtime-analyzer…
drigato Nov 12, 2014
8eaeaf7
airtime_analyzer status_reporter shutdown fix
Nov 12, 2014
2d20e58
Merge branch 'cc-5709-airtime-analyzer' of github.com:sourcefabric/Ai…
Nov 12, 2014
71f2cc1
Fix for incorrect watchdog disabling
Nov 12, 2014
2827db8
Fix bad merge
drigato Nov 13, 2014
7d86ea3
Better error handling on media PUT request
drigato Nov 13, 2014
32bdbe1
Improved some comments
Nov 14, 2014
d42db75
Merge branch 'cc-5709-airtime-analyzer-cloud-storage' of github.com:s…
drigato Nov 18, 2014
3c73abc
SAAS-491: Edit meta data not working
drigato Nov 18, 2014
e7e1926
CC-5950: Fix for issue where clear button in Recent Uploads didn't work
Nov 18, 2014
6460854
Fixed 'clear' button not working when files failed to import
dpsommer Nov 10, 2014
11a3137
Slightly more robust fix for the last issue
Nov 18, 2014
dd3b54f
Actually delete files from the database via the media REST API
Nov 18, 2014
c829b6b
Fix bad merge
Nov 18, 2014
8ffd707
Remove clearAction from the media REST API for security
Nov 20, 2014
7db571d
Remove clearAction from the media REST API for security
Nov 20, 2014
8e8fe2d
SAAS-489: Cannot preview tracks stored on disk
drigato Nov 20, 2014
544767a
Merge branch 'cc-5709-airtime-analyzer-cloud-storage' of github.com:s…
drigato Nov 20, 2014
f08535c
Merge branch '2.5.x' into cc-5709-airtime-analyzer
drigato Nov 26, 2014
884a4c4
Merge branch 'cc-5709-airtime-analyzer' into cc-5709-airtime-analyzer…
drigato Nov 26, 2014
8fbe7dd
Report an error and die if amazon.conf is missing
Nov 26, 2014
670a63d
Error handling for if propel isn't found / composer wasn't run
Nov 26, 2014
e59cd11
Close the session when a track is previewed or downloaded.
drigato Nov 27, 2014
6cb993c
SAAS-504: Store provider in db
drigato Nov 27, 2014
2f93826
Merge branch 'cc-5709-airtime-analyzer-cloud-storage' of github.com:s…
drigato Nov 27, 2014
8601452
Merge conflict
drigato Nov 27, 2014
92feacd
SAAS-501: Re-jig cloud_storage.conf
drigato Nov 27, 2014
432245b
SAAS-502: Analyzer -> Set the station id and domain in the cloud obje…
drigato Nov 27, 2014
7c0a25b
SAAS-505: Extract Amazon_S3 class and have it inherit from a general …
drigato Dec 2, 2014
bf91677
SAAS-505: Extract Amazon_S3 class and have it inherit from a general …
drigato Dec 2, 2014
e1f1807
SAAS-503: PYPO -> Use the REST API to download files
drigato Dec 2, 2014
16dc286
SAAS-503: PYPO -> Use the REST API to download files
drigato Dec 3, 2014
53624d8
SAAS-503: PYPO -> Use the REST API to download filesSAAS-503
drigato Dec 3, 2014
59ceb11
SAAS-510: PYPO -> Files are downloaded even if they already exist in …
drigato Dec 8, 2014
ec189fc
SAAS-509: PYPO can't download files via the REST API
drigato Dec 8, 2014
644e6b0
SAAS-516: Replace Zend_Service_Amazon_S3 with AWS SDK for PHP
drigato Dec 9, 2014
d73b331
SAAS-515: Prefix object names with station name
drigato Dec 10, 2014
38bd45b
Silan cue-in/out analysis now moved to airtime_analyzer
Dec 10, 2014
4dd2768
ReplayGain analysis in airtime_analyzer using python-rgain
Dec 11, 2014
3b1c776
Removed all ReplayGain and Silan stuff from pypo, plus a bugfix
Dec 11, 2014
dbfb2fc
CC-5739: Added Liquidsoap playability test to airtime_analyzer
Dec 11, 2014
29d3d87
Merge branch 'cc-5709-airtime-analyzer' into cc-5709-airtime-analyzer…
drigato Dec 12, 2014
e7a742d
Fixed merge error
drigato Dec 12, 2014
6de8bbe
SAAS-514: PYPO -> Tracks may not become ready in time for playout
drigato Dec 15, 2014
2af14e0
SAAS-519: webstreams not being deleted
drigato Dec 15, 2014
70a2190
Close file descriptors in airtime_analyzer before forking subprocesses
Dec 15, 2014
ff0a685
Updated propel models
drigato Dec 16, 2014
7059820
Add a comment about the proxy pattern
Dec 16, 2014
1de3262
SAAS-527: Allow files to be uploaded to either the cloud or on local …
drigato Dec 16, 2014
6e2f07f
Merge branch 'cc-5709-airtime-analyzer-cloud-storage' of github.com:s…
drigato Dec 16, 2014
cdabbc6
SAAS-527: Allow files to be uploaded to either the cloud or on local …
drigato Dec 17, 2014
3f5b4fa
Cloud storage cleanup and fixed the unit tests
Dec 19, 2014
1718868
Stub CloudStorageAnalyzer tests
Dec 19, 2014
9a8b34f
Unit test tweak for CloudStorage
Dec 19, 2014
13827d9
Added missing config_File.py
Dec 19, 2014
cf57af0
Small analyzer fix
drigato Jan 5, 2015
8d914bc
SAAS-529: Replace Apache Libcloud with Python-Boto SDK
drigato Jan 6, 2015
e5c806f
Merge branch '2.5.x' into cc-5709-airtime-analyzer
drigato Jan 7, 2015
9d6cf86
Merge branch 'cc-5709-airtime-analyzer' into cc-5709-airtime-analyzer…
drigato Jan 7, 2015
2185fc9
SAAS-536: Check for future scheduled files uses cloud_file id instead…
drigato Jan 13, 2015
7d0f165
SAAS-539: Analyzer can return values in scientific notation which are…
drigato Jan 15, 2015
89e760f
Merge branch 'cc-5709-airtime-analyzer' into cc-5709-airtime-analyzer…
drigato Jan 15, 2015
52a6663
SAAS-539: Analyzer can return values in scientific notation which are…
drigato Jan 15, 2015
29c5cf5
Merge branch 'cc-5709-airtime-analyzer' into cc-5709-airtime-analyzer…
drigato Jan 15, 2015
527d285
SAAS-542: ryerson.airtime.pro file doesn't play, preview, or download
drigato Jan 16, 2015
38882ab
SAAS-542: ryerson.airtime.pro file doesn't play, preview, or download
drigato Jan 16, 2015
2c2f7eb
Initial commit for update to ACL for REST module; NEEDS TESTING
dpsommer Jan 21, 2015
a40067c
Moved REST authorization boilerplate to Zend Acl_plugin
dpsommer Jan 21, 2015
38a2924
SAAS-555: Analyzer calculates wrong cue out
drigato Jan 22, 2015
bade613
Merge branch 'cc-5709-airtime-analyzer' into cc-5709-airtime-analyzer…
drigato Jan 22, 2015
230cdcc
Merge branch '2.5.x' into cc-5709-airtime-analyzer
Jan 22, 2015
476128c
Merge branch 'cc-5709-airtime-analyzer' of github.com:sourcefabric/Ai…
Jan 22, 2015
d5ee710
Fixed CSRF token checking in MediaController (broken by last 2 commits)
Jan 22, 2015
6ebe8ec
Pin python-daemon to 1.6 because 2.0.3 breaks setuptools
Jan 22, 2015
134ade8
Merge branch 'cc-5709-airtime-analyzer' into cc-5709-airtime-analyzer…
drigato Jan 22, 2015
6adaf7a
Disabling cue point analyzer
drigato Jan 23, 2015
43c6475
Merge branch 'cc-5709-airtime-analyzer' into cc-5709-airtime-analyzer…
drigato Jan 26, 2015
ea86860
Enabling cuepoint analyzer because the silan bug has been fixed
drigato Jan 27, 2015
3f97ed3
Merge branch 'cc-5709-airtime-analyzer' into cc-5709-airtime-analyzer…
drigato Jan 27, 2015
3f6983a
Renabling CuePointAnalyzer
Feb 2, 2015
ee6862e
Fixed quotation issue with playability analyzer
Feb 2, 2015
3e6f3ab
Merge branch 'cc-5709-airtime-analyzer' of github.com:sourcefabric/Ai…
Feb 2, 2015
536094e
Merge branch 'cc-5709-airtime-analyzer' into cc-5709-airtime-analyzer…
Feb 2, 2015
9baed1b
Make the unit tests pass again
Feb 2, 2015
e32a269
Fixed the unit tests again
Feb 2, 2015
4b6e567
REST permission fix
Feb 6, 2015
2a9790a
Backport ACL REST permission fix
Feb 6, 2015
eb40379
SAAS-595 - Changed Zend validation and added sanitization in file imp…
dpsommer Feb 17, 2015
a07a1ed
SAAS-595 - Updated validation and sanitization
dpsommer Feb 17, 2015
66a6a8f
SAAS-596: Store file size and hash in database
drigato Feb 17, 2015
2ae921e
Merge branch 'cc-5709-airtime-analyzer' of github.com:sourcefabric/Ai…
Feb 18, 2015
17f1d0e
Simplify the metadata sanitization and bugfix it
Feb 18, 2015
487ab9b
CC-5868: Make the BPM field less strict
Feb 19, 2015
cc9e6ef
SAAS-596: Store file size and hash in database
drigato Feb 19, 2015
0177e40
Pull the logic for Media REST API out of the controller
Feb 19, 2015
b6acfb2
SAAS-596: Store file size and hash in database
drigato Feb 19, 2015
6d00da8
Merge branch 'cc-5709-airtime-analyzer-cloud-storage' into cc-5709-ai…
Feb 20, 2015
be7cae4
Fixed CSRF prevention checks for REST calls, moved CSRF initializatio…
dpsommer Feb 20, 2015
61a47ae
Small fix to BPM sanitization
dpsommer Feb 20, 2015
6858316
Merge branch 'cc-5709-airtime-analyzer' of github.com:sourcefabric/Ai…
Feb 20, 2015
73e5fb9
Use more secure random number generation for CSRF auth tokens
Feb 24, 2015
e2130df
Merge branch 'cc-5709-airtime-analyzer-csrf' into cc-5709-airtime-ana…
Feb 24, 2015
90aa1fa
Merge branch '2.5.x' into cc-5709-airtime-analyzer
Feb 24, 2015
a52e2fa
SAAS-602: Fix getaddrinfo deadlock (again)
Feb 24, 2015
25e4fb0
Merge branch 'cc-5709-airtime-analyzer' into cc-5709-airtime-analyzer…
drigato Feb 25, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion airtime_mvc/application/configs/airtime-conf.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
// This file generated by Propel 1.5.2 convert-conf target
// from XML runtime conf file /home/denise/airtime/airtime_mvc/build/runtime-conf.xml
// from XML runtime conf file /home/ubuntu/airtime/airtime_mvc/build/runtime-conf.xml
$conf = array (
'datasources' =>
array (
Expand All @@ -12,6 +12,14 @@
'dsn' => 'pgsql:host=localhost;port=5432;dbname=airtime;user=airtime;password=airtime',
),
),
'airtime_test' =>
array (
'adapter' => 'pgsql',
'connection' =>
array (
'dsn' => 'pgsql:host=localhost;port=5432;dbname=airtime_test;user=airtime;password=airtime',
),
),
'default' => 'airtime',
),
'generator_version' => '1.5.2',
Expand Down
4 changes: 4 additions & 0 deletions airtime_mvc/application/configs/application.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ bootstrap.class = "Bootstrap"
appnamespace = "Application"
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
resources.frontController.params.displayExceptions = 0
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.frontController.plugins.putHandler = "Zend_Controller_Plugin_PutHandler"
;load everything in the modules directory including models
resources.modules[] = ""
resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts/"
resources.view[] =
resources.db.adapter = "Pdo_Pgsql"
Expand Down
4 changes: 3 additions & 1 deletion airtime_mvc/application/controllers/ApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,8 @@ public function recordedShowsAction()

public function uploadFileAction()
{
Logging::error("FIXME: Change the show recorder to use the File Upload API and remove this function."); // Albert - April 3, 2014
/**
$upload_dir = ini_get("upload_tmp_dir");
$tempFilePath = Application_Model_StoredFile::uploadFile($upload_dir);
$tempFileName = basename($tempFilePath);
Expand All @@ -464,7 +466,7 @@ public function uploadFileAction()
$this->_helper->json->sendJson(
array("jsonrpc" => "2.0", "error" => array("code" => $result['code'], "message" => $result['message']))
);
}
}*/
}

public function uploadRecordedAction()
Expand Down
2 changes: 1 addition & 1 deletion airtime_mvc/application/controllers/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function indexAction()

Application_Model_LoginAttempts::resetAttempts($_SERVER['REMOTE_ADDR']);
Application_Model_Subjects::resetLoginAttempts($username);

$tempSess = new Zend_Session_Namespace("referrer");
$tempSess->referrer = 'login';

Expand Down
70 changes: 49 additions & 21 deletions airtime_mvc/application/controllers/PluploadController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

class PluploadController extends Zend_Controller_Action
{

public function init()
{
$ajaxContext = $this->_helper->getHelper('AjaxContext');
$ajaxContext->addActionContext('upload', 'json')
->addActionContext('copyfile', 'json')
$ajaxContext->addActionContext('upload', 'json')
->addActionContext('recent-uploads', 'json')
->initContext();
}

Expand All @@ -18,33 +17,62 @@ public function indexAction()
$baseUrl = Application_Common_OsPath::getBaseDir();
$locale = Application_Model_Preference::GetLocale();

$this->view->headScript()->appendFile($baseUrl.'js/datatables/js/jquery.dataTables.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/plupload/plupload.full.min.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/plupload/jquery.plupload.queue.min.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/airtime/library/plupload.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/plupload/i18n/'.$locale.'.js?'.$CC_CONFIG['airtime_version'],'text/javascript');

$this->view->headLink()->appendStylesheet($baseUrl.'css/plupload.queue.css?'.$CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl.'css/addmedia.css?'.$CC_CONFIG['airtime_version']);
}

public function uploadAction()
{
$upload_dir = ini_get("upload_tmp_dir") . DIRECTORY_SEPARATOR . "plupload";
$tempFilePath = Application_Model_StoredFile::uploadFile($upload_dir);
$tempFileName = basename($tempFilePath);

$this->_helper->json->sendJson(array("jsonrpc" => "2.0", "tempfilepath" => $tempFileName));
}

public function copyfileAction()
public function recentUploadsAction()
{
$upload_dir = ini_get("upload_tmp_dir") . DIRECTORY_SEPARATOR . "plupload";
$filename = $this->_getParam('name');
$tempname = $this->_getParam('tempname');
$result = Application_Model_StoredFile::copyFileToStor($upload_dir,
$filename, $tempname);
if (!is_null($result))
$this->_helper->json->sendJson(array("jsonrpc" => "2.0", "error" => $result));
if (isset($_GET['uploadFilter'])) {
$filter = $_GET['uploadFilter'];
} else {
$filter = "all";
}

$limit = isset($_GET['iDisplayLength']) ? $_GET['iDisplayLength'] : 10;
$rowStart = isset($_GET['iDisplayStart']) ? $_GET['iDisplayStart'] : 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should probably use the zend way to get params


$recentUploadsQuery = CcFilesQuery::create()->filterByDbUtime(array('min' => time() - 30 * 24 * 60 * 60))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this automatically converting a number to a timestamp somewhere? kind of confusing.

->orderByDbUtime(Criteria::DESC);

$numTotalRecentUploads = $recentUploadsQuery->find()->count();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can just use count() without find.


if ($filter == "pending") {
$recentUploadsQuery->filterByDbImportStatus("1");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't need the quotes around the 1 if it's an integer column.

} else if ($filter == "failed") {
$recentUploadsQuery->filterByDbImportStatus(array('min' => 100));
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

datatables expects another count after filtering for the iTotalDisplayRecords field.

$recentUploads = $recentUploadsQuery->offset($rowStart)->limit($limit)->find();

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should use a transaction here to make sure the count/find match.

$numRecentUploads = $limit;
//CcFilesQuery::create()->filterByDbUtime(array('min' => time() - 30 * 24 * 60 * 60))

//$this->_helper->json->sendJson(array("jsonrpc" => "2.0", "tempfilepath" => $tempFileName));

$uploadsArray = array();

foreach ($recentUploads as $upload)
{
$upload->toArray(BasePeer::TYPE_FIELDNAME);
//array_push($uploadsArray, $upload); //TODO: $this->sanitizeResponse($upload));

//$this->_helper->json->sendJson($upload->asJson());
//TODO: Invoke sanitization here
array_push($uploadsArray, $upload->toArray(BasePeer::TYPE_FIELDNAME));
}


$this->_helper->json->sendJson(array("jsonrpc" => "2.0"));
$this->view->sEcho = intval($this->getRequest()->getParam('sEcho'));
$this->view->iTotalDisplayRecords = $numTotalRecentUploads;
//$this->view->iTotalDisplayRecords = $numRecentUploads; //$r["iTotalDisplayRecords"];
$this->view->iTotalRecords = $numTotalRecentUploads; //$r["iTotalRecords"];
$this->view->files = $uploadsArray; //$r["aaData"];
}
}
7 changes: 7 additions & 0 deletions airtime_mvc/application/controllers/plugins/Acl_plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,13 @@ public function preDispatch(Zend_Controller_Request_Abstract $request)
{
$controller = strtolower($request->getControllerName());

//Ignore authentication for all access to the rest API. We do auth via API keys for this
//and/or by OAuth.
if (strtolower($request->getModuleName()) == "rest")
{
return;
}

if (in_array($controller, array("api", "auth", "locale"))) {

$this->setRoleName("G");
Expand Down
4 changes: 3 additions & 1 deletion airtime_mvc/application/models/MusicDir.php
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,9 @@ public static function addWatchedDir($p_path, $userAddedWatchedDir=true, $nested
public static function getDirByPK($pk)
{
$dir = CcMusicDirsQuery::create()->findPK($pk);

if (!$dir) {
return null;
}
$mus_dir = new Application_Model_MusicDir($dir);

return $mus_dir;
Expand Down
20 changes: 20 additions & 0 deletions airtime_mvc/application/models/Preference.php
Original file line number Diff line number Diff line change
Expand Up @@ -1415,4 +1415,24 @@ public static function SetHistoryFileTemplate($value) {
public static function GetHistoryFileTemplate() {
return self::getValue("history_file_template");
}

public static function getDiskUsage()
{
return self::getValue("disk_usage");
}

public static function setDiskUsage($value)
{
self::setValue("disk_usage", $value);
}

public static function updateDiskUsage($filesize)
{
$currentDiskUsage = self::getDiskUsage();
if (empty($currentDiskUsage)) {
$currentDiskUsage = 0;
}

self::setDiskUsage($currentDiskUsage + $filesize);
}
}
26 changes: 21 additions & 5 deletions airtime_mvc/application/models/RabbitMq.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public static function PushSchedule()
self::$doPush = true;
}

private static function sendMessage($exchange, $data)
private static function sendMessage($exchange, $exchangeType, $autoDeleteExchange, $data, $queue="")
{
$CC_CONFIG = Config::getConfig();

Expand All @@ -31,7 +31,9 @@ private static function sendMessage($exchange, $data)
$channel->access_request($CC_CONFIG["rabbitmq"]["vhost"], false, false,
true, true);

$channel->exchange_declare($exchange, 'direct', false, true);
//I'm pretty sure we DON'T want to autodelete ANY exchanges but I'm keeping the code
//the way it is just so I don't accidentally break anything when I add the Analyzer code in. -- Albert, March 13, 2014
$channel->exchange_declare($exchange, $exchangeType, false, true, $autoDeleteExchange);

$msg = new AMQPMessage($data, array('content_type' => 'text/plain'));

Expand All @@ -46,7 +48,7 @@ public static function SendMessageToPypo($event_type, $md)

$exchange = 'airtime-pypo';
$data = json_encode($md, JSON_FORCE_OBJECT);
self::sendMessage($exchange, $data);
self::sendMessage($exchange, 'direct', true, $data);
}

public static function SendMessageToMediaMonitor($event_type, $md)
Expand All @@ -55,7 +57,7 @@ public static function SendMessageToMediaMonitor($event_type, $md)

$exchange = 'airtime-media-monitor';
$data = json_encode($md);
self::sendMessage($exchange, $data);
self::sendMessage($exchange, 'direct', true, $data);
}

public static function SendMessageToShowRecorder($event_type)
Expand All @@ -74,6 +76,20 @@ public static function SendMessageToShowRecorder($event_type)
}
$data = json_encode($temp);

self::sendMessage($exchange, $data);
self::sendMessage($exchange, 'direct', true, $data);
}

public static function SendMessageToAnalyzer($tmpFilePath, $importedStorageDirectory, $originalFilename,
$callbackUrl, $apiKey)
{
$exchange = 'airtime-uploads';
$data['tmp_file_path'] = $tmpFilePath;
$data['import_directory'] = $importedStorageDirectory;
$data['original_filename'] = $originalFilename;
$data['callback_url'] = $callbackUrl;
$data['api_key'] = $apiKey;

$jsonData = json_encode($data);
self::sendMessage($exchange, 'topic', false, $jsonData, 'airtime-uploads');
}
}
Loading