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

Google Drive and Dropbox resolvers #172

Open
wants to merge 90 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
6225ee8
Add KQOauth lib in thirdparty.
AltarBeastiful Feb 10, 2013
abaaf03
Add empty Dropbox account manager and config ui.
AltarBeastiful Feb 10, 2013
ab825ba
Add all parameters returned along with the OAuth token received in th…
AltarBeastiful Feb 10, 2013
5a55a63
Merge branch 'master' of https://github.com/tomahawk-player/tomahawk
AltarBeastiful Feb 10, 2013
d9c9a70
Change the dropbox SVG icon to a lighter one.
AltarBeastiful Feb 11, 2013
9122e1e
Add the link with the custom dropbox account and the JS resolver.
AltarBeastiful Feb 11, 2013
1831838
Add the possibility for JS resolvers to register for signals on their…
AltarBeastiful Feb 14, 2013
ac82eac
Remove Dropbox custom account manager from tomahawk.
AltarBeastiful Feb 14, 2013
92b70fb
Add method to load an external JS file from the resolver folder.
AltarBeastiful Feb 17, 2013
2f3a2e5
Add a method to request a QWebView from a JS resolver.
AltarBeastiful Feb 19, 2013
dc08224
Add Asynch POST request to tomahawk.js
AltarBeastiful Feb 20, 2013
dd0f6d0
Merge remote-tracking branch 'tomaOrigin/master'
AltarBeastiful Feb 20, 2013
80f8a4d
Merge remote-tracking branch 'tomaOrigin/master'
AltarBeastiful Feb 20, 2013
4fb4612
Merge remote-tracking branch 'tomaOrigin/master'
AltarBeastiful Feb 24, 2013
16b636e
Add bind function in tomahawk.js
AltarBeastiful Feb 24, 2013
170a926
add a cloudstream class to manage cloud stream ; add a Q_INVOKABLE me…
Feb 26, 2013
cf0bbcb
merge resolution on QtScriptResolver
Feb 26, 2013
1ad944d
Change QtScriptResolverHelper::customIODeviceFactory to accept url wi…
AltarBeastiful Feb 26, 2013
a1eef2a
Merge branch 'master' of github.com:ISI-Peasy/tomahawk
AltarBeastiful Feb 26, 2013
6bf196c
update of cloudStream reader
loclamor Feb 27, 2013
b43e45a
Fix errors in parsing of ID3 tags (ReadCloudFile)
AltarBeastiful Feb 27, 2013
d196528
messages de debug sur les headers
loclamor Feb 27, 2013
d965af2
ajout du parametre ID a readCloudFile
loclamor Feb 28, 2013
5479175
ajout du parametre fileID a redCloudFile
loclamor Feb 28, 2013
6950daa
header authorization replacement
loclamor Feb 28, 2013
013edb6
tentative de modification du oaut_nonce
loclamor Feb 28, 2013
c8522b7
Add synchronous post request to tomahawk.js
AltarBeastiful Feb 28, 2013
78351e0
QwebInspector for Javascript resolvers.
AltarBeastiful Mar 4, 2013
8081cf4
Merge branch 'master' of https://github.com/tomahawk-player/tomahawk
AltarBeastiful Mar 6, 2013
72fb384
Extra headers and error message for Tomahawk.synchrequest
AltarBeastiful Mar 6, 2013
0ff9909
Change error test for duration of a track
AltarBeastiful Mar 6, 2013
ab46933
Merge branch 'feature/id3tag'
AltarBeastiful Mar 7, 2013
142237c
Merge branch 'master', remote-tracking branch 'tomaOrigin/master'
AltarBeastiful Mar 19, 2013
b41520c
Remove thirdparty KQoauth, not used anymore.
AltarBeastiful Mar 22, 2013
3b4efba
Add licence and source for Tomahawk.bind
AltarBeastiful Mar 22, 2013
f3990bd
Remove dropbox icon from Tomahawk.
AltarBeastiful Mar 22, 2013
5ce025f
Finish deleting of dropbox incon in tomahawk.
AltarBeastiful Mar 22, 2013
4161222
Merge branch 'master' of https://github.com/tomahawk-player/tomahawk
AltarBeastiful Mar 24, 2013
dce4a27
update of cloudstreaming to ask a new streamUrl on HTTP error
loclamor Mar 25, 2013
7e320ea
Add developersExtras when executing JS resolver. Allow the display of…
AltarBeastiful Mar 25, 2013
6e60cc6
use of qjson to encode the json generate by readCloudFile
loclamor Mar 25, 2013
8335844
Repair mistak in customIODeviceFactory.
AltarBeastiful Mar 27, 2013
b74d1df
add a refreshUrlEachTime parameter to cloudstream and readCloudStream…
loclamor Mar 27, 2013
1605fe8
Style convention clean-up
loclamor Mar 28, 2013
d63100b
add a refreshUrlEachTime parameter to cloudstream and readCloudStream…
loclamor Mar 27, 2013
f052557
Style convention clean-up
loclamor Mar 28, 2013
5dcf352
Initial commit for resolver bundles: proof of concept.
teo Mar 10, 2013
c7983d1
Found a better place to do bundle loading, and also load metadata.
teo Mar 11, 2013
fd07667
Headers.
teo Mar 11, 2013
bf76547
Load resolver metadata from JSON file rather than desktop file.
teo Mar 13, 2013
259e285
Return IODevices for track URLs through callbacks.
teo Mar 14, 2013
091b1fa
Allow async streamUrl reports for custom IODeviceFactory resolvers.
teo Mar 14, 2013
4611dca
Use a more explicit parameter name.
teo Mar 14, 2013
dba1ee6
Whoops :)
teo Mar 14, 2013
2a3e1e9
Correctly extract.
teo Mar 15, 2013
7a2147f
Added required scripts loading support to QtScriptResolver.
teo Mar 15, 2013
479e21e
fix typing error on ru-translation
Mar 16, 2013
942f139
Show resolver version for bundles, revision for packaged bundles.
teo Mar 16, 2013
385fc46
Remove bundle directory on account removal.
teo Mar 17, 2013
14d5833
Obsolete TODO is obsolete.
teo Mar 17, 2013
05ee8cd
Add context for placeholders in 3 UI messages added recently
lliehu Mar 19, 2013
4523231
Automatic merge of Transifex translations
Mar 20, 2013
3e25d3d
Install resolver axes in dirs with human-readable name instead of uuid.
teo Mar 20, 2013
0b72a10
Automatic merge of Transifex translations
Mar 22, 2013
ab6c2f8
Remove thirdparty KQoauth, not used anymore.
AltarBeastiful Mar 22, 2013
f90e312
Add licence and source for Tomahawk.bind
AltarBeastiful Mar 22, 2013
c736a8b
Remove dropbox icon from Tomahawk.
AltarBeastiful Mar 22, 2013
a0bb904
Finish deleting of dropbox incon in tomahawk.
AltarBeastiful Mar 22, 2013
0490606
Automatic merge of Transifex translations
Mar 23, 2013
2f98712
* Updated ChangeLog.
muesli Mar 23, 2013
eefea94
Fix GridView layout bug on some GTK styles.
teo Mar 23, 2013
fb11624
Implement locking mechanism to only allow one thread to contact echon…
Horrendus Mar 23, 2013
677e814
use ReadWriteLock instead of Mutex
Horrendus Mar 23, 2013
6131f5e
Automatic merge of Transifex translations
Mar 24, 2013
9f79163
Add a 'Add to Playlist' entry to the ContextMenu
xhochy Mar 24, 2013
72d36b9
Include --verbose in --help
xhochy Mar 24, 2013
f59cfe5
Escape ampersands in menu entry strings
xhochy Mar 24, 2013
e1e12ed
Add ampersand escaping for Albums and Artists
xhochy Mar 24, 2013
bb31fa1
use TomahawkUtils::nam() instead create another qNetworkAccessManager
loclamor Mar 28, 2013
312fe52
Merge remote-tracking branch 'origin/master'
AltarBeastiful Mar 28, 2013
07242f9
Merge branch 'master' of https://github.com/ISI-Peasy/tomahawk
loclamor Mar 28, 2013
5e300db
Merge branch 'feature/id3tag'
loclamor Mar 28, 2013
597203f
correction of conflict resolution error
loclamor Mar 28, 2013
264eb4b
Add header in asynchronous and synchronous custom url handler.
AltarBeastiful Mar 28, 2013
1c5aa22
Parse ID3 tags Asynchronously.
AltarBeastiful Mar 29, 2013
60cfcf3
Remove addLocalJsFile. Now using resolver bundle.
AltarBeastiful Apr 9, 2013
4606a75
Remove syncPostRequest from tomahawk.js
AltarBeastiful Apr 10, 2013
8179ce2
Change function name in tomahawk.js to asyncFormPostRequest.
AltarBeastiful Apr 11, 2013
db71d87
Merge remote-tracking branch 'tomaOrigin/master'
AltarBeastiful Apr 23, 2013
efd3997
Update with the duration with the new result and track interface.
AltarBeastiful Apr 24, 2013
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
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ macro_log_feature(CLucene_FOUND "CLucene" "The open-source, C++ search engine" "
macro_optional_find_package(QJSON)
macro_log_feature(QJSON_FOUND "QJson" "Qt library that maps JSON data to QVariant objects" "http://qjson.sf.net" TRUE "" "libqjson is used for encoding communication between Tomahawk instances")

macro_optional_find_package(Taglib 1.6.0)
macro_optional_find_package(Taglib 1.8.0)
macro_log_feature(TAGLIB_FOUND "TagLib" "Audio Meta-Data Library" "http://developer.kde.org/~wheeler/taglib.html" TRUE "" "taglib is needed for reading meta data from audio files")
include( CheckTagLibFileName )
check_taglib_filename( COMPLEX_TAGLIB_FILENAME )
Expand Down
2 changes: 1 addition & 1 deletion CMakeModules/FindTaglib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ IF(TAGLIB_FOUND)
ELSE()

if(NOT TAGLIB_MIN_VERSION)
set(TAGLIB_MIN_VERSION "1.6")
set(TAGLIB_MIN_VERSION "1.8")
endif(NOT TAGLIB_MIN_VERSION)

if(NOT WIN32)
Expand Down
Binary file added data/images/dropbox-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions data/images/dropbox-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
72 changes: 70 additions & 2 deletions data/js/tomahawk.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,25 +223,37 @@ Tomahawk.valueForSubNode = function(node, tag)
};


Tomahawk.syncRequest = function(url)
Tomahawk.syncRequest = function(url, extraHeaders)
{
var xmlHttpRequest = new XMLHttpRequest();
xmlHttpRequest.open('GET', url, false);

if (extraHeaders) {
for(var headerName in extraHeaders) {
xmlHttpRequest.setRequestHeader(headerName, extraHeaders[headerName]);
}
}

xmlHttpRequest.send(null);
if (xmlHttpRequest.status == 200){
if (xmlHttpRequest.status == 200) {
return xmlHttpRequest.responseText;
} else if (xmlHttpRequest.readyState === 4) {
Tomahawk.log("Failed to do Get request: to: " + url);
Tomahawk.log("Status Code was: " + xmlHttpRequest.status);
}
};

Tomahawk.asyncRequest = function(url, callback, extraHeaders)
{
var xmlHttpRequest = new XMLHttpRequest();
xmlHttpRequest.open('GET', url, true);

if (extraHeaders) {
for(var headerName in extraHeaders) {
xmlHttpRequest.setRequestHeader(headerName, extraHeaders[headerName]);
}
}

xmlHttpRequest.onreadystatechange = function() {
if (xmlHttpRequest.readyState == 4 && xmlHttpRequest.status == 200) {
callback.call(window, xmlHttpRequest);
Expand All @@ -250,9 +262,37 @@ Tomahawk.asyncRequest = function(url, callback, extraHeaders)
Tomahawk.log("Status Code was: " + xmlHttpRequest.status);
}
}

xmlHttpRequest.send(null);
};

Tomahawk.asyncFormPostRequest = function(url, params, callback, extraHeaders)
{
var xmlHttpRequest = new XMLHttpRequest();
xmlHttpRequest.open('POST', url, true);

xmlHttpRequest.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
xmlHttpRequest.setRequestHeader('Content-length', params.length);
xmlHttpRequest.setRequestHeader('Connection', 'close');

if (extraHeaders) {
for(var headerName in extraHeaders) {
xmlHttpRequest.setRequestHeader(headerName, extraHeaders[headerName]);
}
}

xmlHttpRequest.onreadystatechange = function() {
if (xmlHttpRequest.readyState == 4 && xmlHttpRequest.status == 200) {
callback.call(window, xmlHttpRequest);
} else if (xmlHttpRequest.readyState === 4) {
Tomahawk.log("Failed to do POST request: to: " + url);
Tomahawk.log("Status Code was: " + xmlHttpRequest.status);
}
}

xmlHttpRequest.send(params);
};

/**
*
* Secure Hash Algorithm (SHA256)
Expand Down Expand Up @@ -387,6 +427,34 @@ Tomahawk.sha256=function(s){

};

/*
* Bind the function to be executed in the scope of the object oThis.
* Any copyright is dedicated to the Public Domain.
* Source : http://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Function/bind#Compatibility
*/
if (!Function.prototype.bind) {
Function.prototype.bind = function (oThis) {
if (typeof this !== "function") {
// closest thing possible to the ECMAScript 5 internal IsCallable function
throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
}

var aArgs = Array.prototype.slice.call(arguments, 1),
fToBind = this,
fNOP = function () {},
fBound = function () {
return fToBind.apply(this instanceof fNOP && oThis
? this
: oThis,
aArgs.concat(Array.prototype.slice.call(arguments)));
};

fNOP.prototype = this.prototype;
fBound.prototype = new fNOP();

return fBound;
};
}


// some aliases
Expand Down
5 changes: 3 additions & 2 deletions src/AudioControls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,9 @@ AudioControls::onPlaybackStarted( const Tomahawk::result_ptr& result )

qint64 duration = AudioEngine::instance()->currentTrackTotalTime();

if ( duration == -1 )
duration = result.data()->track()->duration() * 1000;
//TODO : check if result->track()->duration() is always valid
if ( duration <= 0 )
duration = result->track()->duration() * 1000;

ui->seekSlider->setRange( 0, duration );
ui->seekSlider->setValue( 0 );
Expand Down
1 change: 1 addition & 0 deletions src/libtomahawk/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ set( libGuiSources
utils/SharedTimeLine.cpp
utils/WebResultHintChecker.cpp
utils/NetworkReply.cpp
utils/CloudStream.cpp

widgets/AnimatedCounterLabel.cpp
widgets/BasicHeader.cpp
Expand Down
Loading