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

Cleanup cordova modules - webpack fix #197

Merged
merged 31 commits into from
Mar 22, 2019

Conversation

vitorsemeano
Copy link
Contributor

@vitorsemeano vitorsemeano commented Mar 17, 2019

This PR removes all cordova requires from site.js. This is in sync with jellyfin/jellyfin-android#109. This will solve all naming resolution problems for webpack compilation related with cordova.

The main points that changed are:

  • deuglification of apphost.js
  • added NativeShell API to multiple modules that were defined in jf-android and included in site.js
  • removed some modules that serve no purpose

@@ -99,15 +105,26 @@ define(['playbackManager', 'nowPlayingHelper', 'events', 'connectionManager'], f
return;
}

// dummy this up
Copy link
Contributor

Choose a reason for hiding this comment

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

can you explain the comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

well if you are asking if i wrote it, no. The actual meaning.. searching for it in google, i found this: https://www.urbandictionary.com/define.php?term=Dummy-up

There is an implementation to prevent notifications like hell to upade mediaSession info. So this should belong to that implementation. I don't know. I could remove the comment.

Copy link
Contributor

Choose a reason for hiding this comment

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

I was wondering what this thing does and what this comment means...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well the code transforms init events into timeupdate for the function context. Then what i see is if event type if timeupdate and there as an update with an interval lesser than 5 seconds, then ignore the player state update. This code was in jf-android initially, but not in jf-web, but i found traces of it in jf-web, like the lastUpdateTime defined, but never used. I think it makes sense to not update very frequently the mediasession if event is timeupdate. If we find some issue with the refresh rate of the sticky notification, we should investigate further, and try to decrease the time between updates.

Copy link
Contributor

Choose a reason for hiding this comment

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

I got the code about time updates.

So after your explanation I propose to remove // dummy this up and add a comment like // transform "init" event into "timeupdate" within this function context inside the if().

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure np, will do

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's done

@vitorsemeano
Copy link
Contributor Author

Take note that the other PR associated with this one, in jf-android, needs this one to properly work.

Copy link
Contributor

@JustAMan JustAMan left a comment

Choose a reason for hiding this comment

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

LGTM.

Would also be good if you could fix my suggestion #197 (comment)

@joshuaboniface
Copy link
Member

LGTM too, can you fix up the conflict?

@vitorsemeano
Copy link
Contributor Author

Only when I get in front of my pc, later today. You will have to wait a couple of hours

@vitorsemeano
Copy link
Contributor Author

I detected a bug related with this PR that affects audio play. Please hold the merge till i resolve the issue.

@vitorsemeano
Copy link
Contributor Author

The problem is not in this PR but it's in my already approved PR in jf-android.

I made a new PR to address this issue: jellyfin/jellyfin-android#112

@joshuaboniface joshuaboniface merged commit 85a7b34 into jellyfin:master Mar 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants