├── .babelrc ├── .eslintrc ├── .flowconfig ├── .gitignore ├── .tern-project ├── LICENSE ├── README.md ├── React └── RCTImageDownloader │ └── Cache.db ├── flow └── react-native-macos.js ├── index.macos.js ├── macos ├── AppIcon.icns ├── AudioPlayer │ ├── AudioPlayer.h │ └── AudioPlayer.m ├── PlexMusic.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ └── PlexMusic.xcscheme ├── PlexMusic │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Images.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Info.plist │ └── main.m └── RNVectorIconsManager │ ├── RNVectorIconsManager.h │ └── RNVectorIconsManager.m ├── package.json ├── screenshot.png └── src ├── App.js ├── Models ├── Album.js ├── Artist.js ├── Model.js ├── Section.js ├── Track.js └── index.js ├── Screens ├── LoginScreen │ ├── DeviceList │ │ ├── DeviceListItem.js │ │ └── index.js │ ├── LoginView.js │ └── index.js ├── MainScreen │ └── index.js ├── PlayerScreen │ ├── AlbumListView │ │ ├── AlbumList.js │ │ ├── AlbumListItem.js │ │ ├── AlbumListView.js │ │ ├── Support.js │ │ ├── Types.js │ │ └── index.js │ ├── NowPlaying.js │ ├── PlayListView │ │ ├── PlayList.js │ │ ├── PlayListItem.js │ │ └── index.js │ ├── PlayerView │ │ ├── PlaybackButtons.js │ │ ├── SeekBar.js │ │ └── index.js │ └── index.js └── index.js ├── Stores ├── Account │ ├── Account.js │ ├── ConnectionParams.js │ ├── Device.js │ ├── Types.js │ └── index.js ├── AppState │ ├── AppState.js │ ├── Connection │ │ ├── AlbumEndpoint.js │ │ ├── ArtistEndpoint.js │ │ ├── Connection.js │ │ ├── Endpoint.js │ │ ├── SectionEndpoint.js │ │ ├── TrackEndpoint.js │ │ └── index.js │ └── index.js ├── PlayQueue │ ├── PlayQueue.js │ ├── Types.js │ └── index.js └── index.js └── UI ├── LoadingView.js ├── Tab.js └── index.js /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | "react-native" 4 | ], 5 | "plugins": [ 6 | "transform-decorators-legacy" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "parser": "babel-eslint", 3 | "extends": [ 4 | "plugin:lodash/recommended", 5 | "plugin:flowtype/recommended", 6 | "airbnb" 7 | ], 8 | "rules": { 9 | "class-methods-use-this": "off", 10 | "comma-dangle": ["warn", "never"], 11 | "import/prefer-default-export": "off", 12 | "max-len": "off", 13 | "no-underscore-dangle": "off", 14 | "react/jsx-filename-extension": "off", 15 | "react/prefer-stateless-function": "off", 16 | "react/sort-comp": "off", 17 | "semi": ["warn", "never"] 18 | }, 19 | "plugins": [ 20 | "import", 21 | "react", 22 | "react-native", 23 | "lodash", 24 | "flowtype" 25 | ], 26 | "settings": { 27 | "import/resolver": { 28 | "babel-module": {} 29 | } 30 | }, 31 | "globals": { 32 | "__DEV__": true 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | /React/.* 3 | /macos/.* 4 | /node_modules/react-native-macos/lib/.* 5 | /node_modules/react-native-macos/local-cli/.* 6 | /node_modules/react-native-macos/Libraries/.* 7 | 8 | [include] 9 | 10 | [libs] 11 | ./flow 12 | #./node_modules/react-native-macos/Libraries/react-native/react-native-interface.js 13 | #./node_modules/react-native-macos/flow 14 | 15 | [options] 16 | esproposal.class_instance_fields=enable 17 | esproposal.class_static_fields=enable 18 | esproposal.decorators=ignore 19 | experimental.strict_type_args=true 20 | module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub' 21 | module.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub' 22 | module.system=haste 23 | munge_underscores=true 24 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy 25 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(3[0-2]\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) 26 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(3[0-2]\\|1[0-9]\\|[1-2][0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ 27 | suppress_type=$FixMe 28 | suppress_type=$FlowFixMe 29 | suppress_type=$FlowIssue 30 | unsafe.enable_getters_and_setters=true 31 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | ModuleCache/ 9 | *.pbxuser 10 | !default.pbxuser 11 | *.mode1v3 12 | !default.mode1v3 13 | *.mode2v3 14 | !default.mode2v3 15 | *.perspectivev3 16 | !default.perspectivev3 17 | xcuserdata 18 | *.xccheckout 19 | *.moved-aside 20 | DerivedData 21 | *.hmap 22 | *.ipa 23 | *.xcuserstate 24 | project.xcworkspace 25 | macos/info.plist 26 | 27 | # Android/IJ 28 | # 29 | .idea 30 | .gradle 31 | local.properties 32 | 33 | # node.js 34 | # 35 | node_modules/ 36 | npm-debug.log 37 | 38 | # BUCK 39 | buck-out/ 40 | \.buckd/ 41 | android/app/libs 42 | android/keystores/debug.keystore 43 | -------------------------------------------------------------------------------- /.tern-project: -------------------------------------------------------------------------------- 1 | { 2 | "ecmaVersion": 6, 3 | "libs": [], 4 | "plugins": { 5 | "complete_strings": {}, 6 | "node": {}, 7 | "requirejs": {}, 8 | "modules": {}, 9 | "es_modules": {}, 10 | "doc_comment": { 11 | "fullDocs": true 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Plex Music 2 | 3 | ![Screenshot](screenshot.png) 4 | -------------------------------------------------------------------------------- /React/RCTImageDownloader/Cache.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knoopx/plex-music-react-native-macosx/cc965b8db32847bb9ba14f7ddb057e4c520383ad/React/RCTImageDownloader/Cache.db -------------------------------------------------------------------------------- /flow/react-native-macos.js: -------------------------------------------------------------------------------- 1 | declare module 'react-native-macos' { 2 | declare var exports: any; 3 | } 4 | -------------------------------------------------------------------------------- /index.macos.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-console */ 2 | 3 | import mobx from 'mobx' 4 | import { AppRegistry } from 'react-native-macos' 5 | import App from './src/App' 6 | 7 | AppRegistry.registerComponent('PlexMusic', () => App) 8 | 9 | const style = 'color: #006d92; font-weight:bold;' 10 | const repeat = (str, times) => (new Array(times + 1)).join(str) 11 | const pad = (num, maxLength) => repeat('0', maxLength - num.toString().length) + num 12 | const formatTime = time => `${pad(time.getHours(), 2)}:${pad(time.getMinutes(), 2)}:${pad(time.getSeconds(), 2)}.${pad(time.getMilliseconds(), 3)}` 13 | 14 | if (__DEV__) { 15 | console.ignoredYellowBox = ['Warning: In next release empty section headers will be rendered'] 16 | 17 | mobx.spy((event) => { 18 | if (event.type === 'action') { 19 | console.groupCollapsed(`Action @ ${formatTime(new Date())} ${event.name}`) 20 | console.log('%cType: ', style, event.type) 21 | console.log('%cName: ', style, event.name) 22 | console.log('%cTarget: ', style, event.target) 23 | console.log('%cArguments: ', style, event.arguments) 24 | console.groupEnd() 25 | } 26 | }) 27 | } 28 | -------------------------------------------------------------------------------- /macos/AppIcon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knoopx/plex-music-react-native-macosx/cc965b8db32847bb9ba14f7ddb057e4c520383ad/macos/AppIcon.icns -------------------------------------------------------------------------------- /macos/AudioPlayer/AudioPlayer.h: -------------------------------------------------------------------------------- 1 | #import "RCTBridgeModule.h" 2 | #import "RCTLog.h" 3 | #import 4 | 5 | @interface AudioPlayer : NSObject 6 | 7 | @end 8 | -------------------------------------------------------------------------------- /macos/AudioPlayer/AudioPlayer.m: -------------------------------------------------------------------------------- 1 | #import "AudioPlayer.h" 2 | #import "RCTConvert.h" 3 | #import "RCTBridge.h" 4 | #import "RCTEventDispatcher.h" 5 | 6 | @interface AudioPlayer() 7 | @property(nonatomic, strong) AVPlayer* audioPlayer; 8 | @property(nonatomic, strong) AVPlayer* player; 9 | @property(nonatomic, strong) AVPlayerItem *playerItem; 10 | @end 11 | 12 | @implementation AudioPlayer 13 | 14 | @synthesize bridge = _bridge; 15 | 16 | RCT_EXPORT_MODULE() 17 | 18 | RCT_EXPORT_METHOD(play:(NSString *)url) 19 | { 20 | if (_playerItem) { 21 | [_playerItem removeObserver:self forKeyPath:@"status"]; 22 | [_playerItem removeObserver:self forKeyPath:@"playbackLikelyToKeepUp"]; 23 | 24 | [[NSNotificationCenter defaultCenter] removeObserver:self 25 | name:AVPlayerItemDidPlayToEndTimeNotification 26 | object:_playerItem]; 27 | 28 | } 29 | _player = [[AVPlayer alloc]initWithURL:[NSURL URLWithString:url]]; 30 | _playerItem = [_player currentItem]; 31 | 32 | [[NSNotificationCenter defaultCenter] addObserver:self 33 | selector:@selector(playerItemDidReachEnd:) 34 | name:AVPlayerItemDidPlayToEndTimeNotification 35 | object:[_player currentItem]]; 36 | 37 | [_playerItem addObserver:self forKeyPath:@"status" options:0 context:nil]; 38 | [_playerItem addObserver:self forKeyPath:@"playbackLikelyToKeepUp" options:0 context:nil]; 39 | [_player play]; 40 | } 41 | 42 | - (void)playerItemDidReachEnd:(NSNotification *)notification 43 | { 44 | [_bridge.eventDispatcher sendDeviceEventWithName:@"onPlaybackEnd" body:@{}]; 45 | } 46 | 47 | 48 | RCT_EXPORT_METHOD(pause) 49 | { 50 | [_player pause]; 51 | } 52 | 53 | RCT_EXPORT_METHOD(resume) 54 | { 55 | [_player play]; 56 | } 57 | 58 | RCT_EXPORT_METHOD(setCurrentTime:(nonnull NSNumber*)value) { 59 | CMTime time = CMTimeMakeWithSeconds([value doubleValue], _player.rate); 60 | [_player seekToTime: time]; 61 | } 62 | 63 | RCT_EXPORT_METHOD(getProgress:(RCTResponseSenderBlock)callback) 64 | { 65 | AVPlayerItem *item = [_player currentItem]; 66 | callback(@[[NSNull null], @{@"currentTime": [NSNumber numberWithFloat:CMTimeGetSeconds(item.currentTime)], 67 | @"playableDuration": [self calculatePlayableDuration]}]); 68 | } 69 | 70 | - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context 71 | { 72 | if (object == _playerItem) { 73 | 74 | if ([keyPath isEqualToString:@"status"]) { 75 | if (_playerItem.status == AVPlayerItemStatusReadyToPlay) { 76 | float duration = CMTimeGetSeconds(_playerItem.asset.duration); 77 | if (isnan(duration)) { 78 | duration = 0.0; 79 | } 80 | 81 | [_bridge.eventDispatcher sendDeviceEventWithName:@"onPlaybackLoad" 82 | body:@{@"duration": [NSNumber numberWithFloat:duration], 83 | @"currentTime": [NSNumber numberWithFloat:CMTimeGetSeconds(_playerItem.currentTime)], 84 | @"canPlayReverse": [NSNumber numberWithBool:_playerItem.canPlayReverse], 85 | @"canPlayFastForward": [NSNumber numberWithBool:_playerItem.canPlayFastForward], 86 | @"canPlaySlowForward": [NSNumber numberWithBool:_playerItem.canPlaySlowForward], 87 | @"canPlaySlowReverse": [NSNumber numberWithBool:_playerItem.canPlaySlowReverse], 88 | @"canStepBackward": [NSNumber numberWithBool:_playerItem.canStepBackward], 89 | @"canStepForward": [NSNumber numberWithBool:_playerItem.canStepForward]}]; 90 | 91 | } else if(_playerItem.status == AVPlayerItemStatusFailed) { 92 | [_bridge.eventDispatcher sendDeviceEventWithName:@"onPlaybackError" 93 | body:@{@"error": @{ 94 | @"code": [NSNumber numberWithInteger: _playerItem.error.code], 95 | @"domain": _playerItem.error.domain}}]; 96 | } 97 | } else if ([keyPath isEqualToString:@"playbackLikelyToKeepUp"]) { 98 | // buffering 99 | } 100 | } else { 101 | [super observeValueForKeyPath:keyPath ofObject:object change:change context:context]; 102 | } 103 | } 104 | 105 | 106 | - (void)sendProgressUpdate 107 | { 108 | AVPlayerItem *video = [_player currentItem]; 109 | if (video == nil || video.status != AVPlayerItemStatusReadyToPlay) { 110 | return; 111 | } 112 | 113 | [_bridge.eventDispatcher sendDeviceEventWithName:@"onPlaybackProgress" 114 | body:@{@"currentTime": [NSNumber numberWithFloat:CMTimeGetSeconds(video.currentTime)], 115 | @"playableDuration": [self calculatePlayableDuration]}]; 116 | } 117 | 118 | - (NSNumber *)calculatePlayableDuration 119 | { 120 | AVPlayerItem *video = _player.currentItem; 121 | if (video.status == AVPlayerItemStatusReadyToPlay) { 122 | __block CMTimeRange effectiveTimeRange; 123 | [video.loadedTimeRanges enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { 124 | CMTimeRange timeRange = [obj CMTimeRangeValue]; 125 | if (CMTimeRangeContainsTime(timeRange, video.currentTime)) { 126 | effectiveTimeRange = timeRange; 127 | *stop = YES; 128 | } 129 | }]; 130 | Float64 playableDuration = CMTimeGetSeconds(CMTimeRangeGetEnd(effectiveTimeRange)); 131 | if (playableDuration > 0) { 132 | return [NSNumber numberWithFloat:playableDuration]; 133 | } 134 | } 135 | return [NSNumber numberWithInteger:0]; 136 | } 137 | 138 | 139 | @end 140 | -------------------------------------------------------------------------------- /macos/PlexMusic.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */; }; 11 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; }; 12 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78C398B91ACF4ADC00677621 /* libRCTLinking.a */; }; 13 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */; }; 14 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */; }; 15 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; 16 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 17 | 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 18 | 146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; 19 | 4ACC972C1D6DC6500050EDDB /* AudioPlayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 4ACC972B1D6DC6500050EDDB /* AudioPlayer.m */; }; 20 | 4ACC97371D6DC6560050EDDB /* RNVectorIconsManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 4ACC97361D6DC6560050EDDB /* RNVectorIconsManager.m */; }; 21 | 4ACC975B1D6DDB190050EDDB /* Fonts in Resources */ = {isa = PBXBuildFile; fileRef = 4ACC975A1D6DDB190050EDDB /* Fonts */; }; 22 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; }; 23 | /* End PBXBuildFile section */ 24 | 25 | /* Begin PBXContainerItemProxy section */ 26 | 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */ = { 27 | isa = PBXContainerItemProxy; 28 | containerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; 29 | proxyType = 2; 30 | remoteGlobalIDString = 58B5115D1A9E6B3D00147676; 31 | remoteInfo = RCTImage; 32 | }; 33 | 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */ = { 34 | isa = PBXContainerItemProxy; 35 | containerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; 36 | proxyType = 2; 37 | remoteGlobalIDString = 58B511DB1A9E6C8500147676; 38 | remoteInfo = RCTNetwork; 39 | }; 40 | 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */ = { 41 | isa = PBXContainerItemProxy; 42 | containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; 43 | proxyType = 2; 44 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 45 | remoteInfo = RCTSettings; 46 | }; 47 | 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */ = { 48 | isa = PBXContainerItemProxy; 49 | containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 50 | proxyType = 2; 51 | remoteGlobalIDString = 3C86DF461ADF2C930047B81A; 52 | remoteInfo = RCTWebSocket; 53 | }; 54 | 146834031AC3E56700842450 /* PBXContainerItemProxy */ = { 55 | isa = PBXContainerItemProxy; 56 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 57 | proxyType = 2; 58 | remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192; 59 | remoteInfo = React; 60 | }; 61 | 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */ = { 62 | isa = PBXContainerItemProxy; 63 | containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; 64 | proxyType = 2; 65 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 66 | remoteInfo = RCTLinking; 67 | }; 68 | 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */ = { 69 | isa = PBXContainerItemProxy; 70 | containerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; 71 | proxyType = 2; 72 | remoteGlobalIDString = 58B5119B1A9E6C1200147676; 73 | remoteInfo = RCTText; 74 | }; 75 | /* End PBXContainerItemProxy section */ 76 | 77 | /* Begin PBXFileReference section */ 78 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = "../node_modules/react-native-macos/Libraries/Image/RCTImage.xcodeproj"; sourceTree = ""; }; 79 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = "../node_modules/react-native-macos/Libraries/Network/RCTNetwork.xcodeproj"; sourceTree = ""; }; 80 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = "../node_modules/react-native-macos/Libraries/Settings/RCTSettings.xcodeproj"; sourceTree = ""; }; 81 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocket.xcodeproj; path = "../node_modules/react-native-macos/Libraries/WebSocket/RCTWebSocket.xcodeproj"; sourceTree = ""; }; 82 | 13B07F961A680F5B00A75B9A /* PlexMusic.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PlexMusic.app; sourceTree = BUILT_PRODUCTS_DIR; }; 83 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = PlexMusic/AppDelegate.h; sourceTree = ""; }; 84 | 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = PlexMusic/AppDelegate.m; sourceTree = ""; }; 85 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = PlexMusic/Images.xcassets; sourceTree = ""; }; 86 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = PlexMusic/Info.plist; sourceTree = ""; }; 87 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = PlexMusic/main.m; sourceTree = ""; }; 88 | 146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "../node_modules/react-native-macos/React/React.xcodeproj"; sourceTree = ""; }; 89 | 4ACC972A1D6DC6500050EDDB /* AudioPlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudioPlayer.h; sourceTree = ""; }; 90 | 4ACC972B1D6DC6500050EDDB /* AudioPlayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AudioPlayer.m; sourceTree = ""; }; 91 | 4ACC97351D6DC6560050EDDB /* RNVectorIconsManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNVectorIconsManager.h; sourceTree = ""; }; 92 | 4ACC97361D6DC6560050EDDB /* RNVectorIconsManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNVectorIconsManager.m; sourceTree = ""; }; 93 | 4ACC975A1D6DDB190050EDDB /* Fonts */ = {isa = PBXFileReference; lastKnownFileType = folder; name = Fonts; path = "../node_modules/react-native-vector-icons/Fonts"; sourceTree = ""; }; 94 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native-macos/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = ""; }; 95 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native-macos/Libraries/Text/RCTText.xcodeproj"; sourceTree = ""; }; 96 | /* End PBXFileReference section */ 97 | 98 | /* Begin PBXFrameworksBuildPhase section */ 99 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { 100 | isa = PBXFrameworksBuildPhase; 101 | buildActionMask = 2147483647; 102 | files = ( 103 | 146834051AC3E58100842450 /* libReact.a in Frameworks */, 104 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */, 105 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */, 106 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */, 107 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */, 108 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */, 109 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */, 110 | ); 111 | runOnlyForDeploymentPostprocessing = 0; 112 | }; 113 | /* End PBXFrameworksBuildPhase section */ 114 | 115 | /* Begin PBXGroup section */ 116 | 00C302BC1ABCB91800DB3ED1 /* Products */ = { 117 | isa = PBXGroup; 118 | children = ( 119 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */, 120 | ); 121 | name = Products; 122 | sourceTree = ""; 123 | }; 124 | 00C302D41ABCB9D200DB3ED1 /* Products */ = { 125 | isa = PBXGroup; 126 | children = ( 127 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */, 128 | ); 129 | name = Products; 130 | sourceTree = ""; 131 | }; 132 | 139105B71AF99BAD00B5F7CC /* Products */ = { 133 | isa = PBXGroup; 134 | children = ( 135 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */, 136 | ); 137 | name = Products; 138 | sourceTree = ""; 139 | }; 140 | 139FDEE71B06529A00C62182 /* Products */ = { 141 | isa = PBXGroup; 142 | children = ( 143 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */, 144 | ); 145 | name = Products; 146 | sourceTree = ""; 147 | }; 148 | 13B07FAE1A68108700A75B9A /* PlexMusic */ = { 149 | isa = PBXGroup; 150 | children = ( 151 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */, 152 | 13B07FB01A68108700A75B9A /* AppDelegate.m */, 153 | 13B07FB51A68108700A75B9A /* Images.xcassets */, 154 | 13B07FB61A68108700A75B9A /* Info.plist */, 155 | 13B07FB71A68108700A75B9A /* main.m */, 156 | ); 157 | name = PlexMusic; 158 | sourceTree = ""; 159 | }; 160 | 146834001AC3E56700842450 /* Products */ = { 161 | isa = PBXGroup; 162 | children = ( 163 | 146834041AC3E56700842450 /* libReact.a */, 164 | ); 165 | name = Products; 166 | sourceTree = ""; 167 | }; 168 | 4ACC97291D6DC6500050EDDB /* AudioPlayer */ = { 169 | isa = PBXGroup; 170 | children = ( 171 | 4ACC972A1D6DC6500050EDDB /* AudioPlayer.h */, 172 | 4ACC972B1D6DC6500050EDDB /* AudioPlayer.m */, 173 | ); 174 | path = AudioPlayer; 175 | sourceTree = ""; 176 | }; 177 | 4ACC97341D6DC6560050EDDB /* RNVectorIconsManager */ = { 178 | isa = PBXGroup; 179 | children = ( 180 | 4ACC97351D6DC6560050EDDB /* RNVectorIconsManager.h */, 181 | 4ACC97361D6DC6560050EDDB /* RNVectorIconsManager.m */, 182 | ); 183 | path = RNVectorIconsManager; 184 | sourceTree = ""; 185 | }; 186 | 78C398B11ACF4ADC00677621 /* Products */ = { 187 | isa = PBXGroup; 188 | children = ( 189 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */, 190 | ); 191 | name = Products; 192 | sourceTree = ""; 193 | }; 194 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = { 195 | isa = PBXGroup; 196 | children = ( 197 | 146833FF1AC3E56700842450 /* React.xcodeproj */, 198 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */, 199 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */, 200 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */, 201 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */, 202 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */, 203 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */, 204 | ); 205 | name = Libraries; 206 | sourceTree = ""; 207 | }; 208 | 832341B11AAA6A8300B99B32 /* Products */ = { 209 | isa = PBXGroup; 210 | children = ( 211 | 832341B51AAA6A8300B99B32 /* libRCTText.a */, 212 | ); 213 | name = Products; 214 | sourceTree = ""; 215 | }; 216 | 83CBB9F61A601CBA00E9B192 = { 217 | isa = PBXGroup; 218 | children = ( 219 | 4ACC97341D6DC6560050EDDB /* RNVectorIconsManager */, 220 | 4ACC97291D6DC6500050EDDB /* AudioPlayer */, 221 | 13B07FAE1A68108700A75B9A /* PlexMusic */, 222 | 832341AE1AAA6A7D00B99B32 /* Libraries */, 223 | 83CBBA001A601CBA00E9B192 /* Products */, 224 | 4ACC975A1D6DDB190050EDDB /* Fonts */, 225 | ); 226 | indentWidth = 2; 227 | sourceTree = ""; 228 | tabWidth = 2; 229 | }; 230 | 83CBBA001A601CBA00E9B192 /* Products */ = { 231 | isa = PBXGroup; 232 | children = ( 233 | 13B07F961A680F5B00A75B9A /* PlexMusic.app */, 234 | ); 235 | name = Products; 236 | sourceTree = ""; 237 | }; 238 | /* End PBXGroup section */ 239 | 240 | /* Begin PBXNativeTarget section */ 241 | 13B07F861A680F5B00A75B9A /* PlexMusic */ = { 242 | isa = PBXNativeTarget; 243 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "PlexMusic" */; 244 | buildPhases = ( 245 | 13B07F871A680F5B00A75B9A /* Sources */, 246 | 13B07F8C1A680F5B00A75B9A /* Frameworks */, 247 | 13B07F8E1A680F5B00A75B9A /* Resources */, 248 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, 249 | ); 250 | buildRules = ( 251 | ); 252 | dependencies = ( 253 | ); 254 | name = PlexMusic; 255 | productName = "Hello World"; 256 | productReference = 13B07F961A680F5B00A75B9A /* PlexMusic.app */; 257 | productType = "com.apple.product-type.application"; 258 | }; 259 | /* End PBXNativeTarget section */ 260 | 261 | /* Begin PBXProject section */ 262 | 83CBB9F71A601CBA00E9B192 /* Project object */ = { 263 | isa = PBXProject; 264 | attributes = { 265 | LastUpgradeCheck = 0800; 266 | ORGANIZATIONNAME = Facebook; 267 | }; 268 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "PlexMusic" */; 269 | compatibilityVersion = "Xcode 3.2"; 270 | developmentRegion = English; 271 | hasScannedForEncodings = 0; 272 | knownRegions = ( 273 | en, 274 | Base, 275 | ); 276 | mainGroup = 83CBB9F61A601CBA00E9B192; 277 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; 278 | projectDirPath = ""; 279 | projectReferences = ( 280 | { 281 | ProductGroup = 00C302BC1ABCB91800DB3ED1 /* Products */; 282 | ProjectRef = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; 283 | }, 284 | { 285 | ProductGroup = 78C398B11ACF4ADC00677621 /* Products */; 286 | ProjectRef = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; 287 | }, 288 | { 289 | ProductGroup = 00C302D41ABCB9D200DB3ED1 /* Products */; 290 | ProjectRef = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; 291 | }, 292 | { 293 | ProductGroup = 139105B71AF99BAD00B5F7CC /* Products */; 294 | ProjectRef = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; 295 | }, 296 | { 297 | ProductGroup = 832341B11AAA6A8300B99B32 /* Products */; 298 | ProjectRef = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; 299 | }, 300 | { 301 | ProductGroup = 139FDEE71B06529A00C62182 /* Products */; 302 | ProjectRef = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 303 | }, 304 | { 305 | ProductGroup = 146834001AC3E56700842450 /* Products */; 306 | ProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */; 307 | }, 308 | ); 309 | projectRoot = ""; 310 | targets = ( 311 | 13B07F861A680F5B00A75B9A /* PlexMusic */, 312 | ); 313 | }; 314 | /* End PBXProject section */ 315 | 316 | /* Begin PBXReferenceProxy section */ 317 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */ = { 318 | isa = PBXReferenceProxy; 319 | fileType = archive.ar; 320 | path = libRCTImage.a; 321 | remoteRef = 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */; 322 | sourceTree = BUILT_PRODUCTS_DIR; 323 | }; 324 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */ = { 325 | isa = PBXReferenceProxy; 326 | fileType = archive.ar; 327 | path = libRCTNetwork.a; 328 | remoteRef = 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */; 329 | sourceTree = BUILT_PRODUCTS_DIR; 330 | }; 331 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */ = { 332 | isa = PBXReferenceProxy; 333 | fileType = archive.ar; 334 | path = libRCTSettings.a; 335 | remoteRef = 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */; 336 | sourceTree = BUILT_PRODUCTS_DIR; 337 | }; 338 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */ = { 339 | isa = PBXReferenceProxy; 340 | fileType = archive.ar; 341 | path = libRCTWebSocket.a; 342 | remoteRef = 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */; 343 | sourceTree = BUILT_PRODUCTS_DIR; 344 | }; 345 | 146834041AC3E56700842450 /* libReact.a */ = { 346 | isa = PBXReferenceProxy; 347 | fileType = archive.ar; 348 | path = libReact.a; 349 | remoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */; 350 | sourceTree = BUILT_PRODUCTS_DIR; 351 | }; 352 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */ = { 353 | isa = PBXReferenceProxy; 354 | fileType = archive.ar; 355 | path = libRCTLinking.a; 356 | remoteRef = 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */; 357 | sourceTree = BUILT_PRODUCTS_DIR; 358 | }; 359 | 832341B51AAA6A8300B99B32 /* libRCTText.a */ = { 360 | isa = PBXReferenceProxy; 361 | fileType = archive.ar; 362 | path = libRCTText.a; 363 | remoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */; 364 | sourceTree = BUILT_PRODUCTS_DIR; 365 | }; 366 | /* End PBXReferenceProxy section */ 367 | 368 | /* Begin PBXResourcesBuildPhase section */ 369 | 13B07F8E1A680F5B00A75B9A /* Resources */ = { 370 | isa = PBXResourcesBuildPhase; 371 | buildActionMask = 2147483647; 372 | files = ( 373 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, 374 | 4ACC975B1D6DDB190050EDDB /* Fonts in Resources */, 375 | ); 376 | runOnlyForDeploymentPostprocessing = 0; 377 | }; 378 | /* End PBXResourcesBuildPhase section */ 379 | 380 | /* Begin PBXShellScriptBuildPhase section */ 381 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = { 382 | isa = PBXShellScriptBuildPhase; 383 | buildActionMask = 2147483647; 384 | files = ( 385 | ); 386 | inputPaths = ( 387 | ); 388 | name = "Bundle React Native code and images"; 389 | outputPaths = ( 390 | ); 391 | runOnlyForDeploymentPostprocessing = 0; 392 | shellPath = /bin/sh; 393 | shellScript = "../node_modules/react-native-macos/packager/react-native-xcode.sh"; 394 | }; 395 | /* End PBXShellScriptBuildPhase section */ 396 | 397 | /* Begin PBXSourcesBuildPhase section */ 398 | 13B07F871A680F5B00A75B9A /* Sources */ = { 399 | isa = PBXSourcesBuildPhase; 400 | buildActionMask = 2147483647; 401 | files = ( 402 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */, 403 | 4ACC972C1D6DC6500050EDDB /* AudioPlayer.m in Sources */, 404 | 13B07FC11A68108700A75B9A /* main.m in Sources */, 405 | 4ACC97371D6DC6560050EDDB /* RNVectorIconsManager.m in Sources */, 406 | ); 407 | runOnlyForDeploymentPostprocessing = 0; 408 | }; 409 | /* End PBXSourcesBuildPhase section */ 410 | 411 | /* Begin XCBuildConfiguration section */ 412 | 13B07F941A680F5B00A75B9A /* Debug */ = { 413 | isa = XCBuildConfiguration; 414 | buildSettings = { 415 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 416 | COMBINE_HIDPI_IMAGES = YES; 417 | DEAD_CODE_STRIPPING = NO; 418 | HEADER_SEARCH_PATHS = ( 419 | "$(inherited)", 420 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 421 | "$(SRCROOT)/../node_modules/react-native-macos/React/**", 422 | ); 423 | INFOPLIST_FILE = PlexMusic/Info.plist; 424 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 425 | OTHER_LDFLAGS = ( 426 | "-ObjC", 427 | "-lc++", 428 | ); 429 | PRODUCT_NAME = PlexMusic; 430 | }; 431 | name = Debug; 432 | }; 433 | 13B07F951A680F5B00A75B9A /* Release */ = { 434 | isa = XCBuildConfiguration; 435 | buildSettings = { 436 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 437 | COMBINE_HIDPI_IMAGES = YES; 438 | HEADER_SEARCH_PATHS = ( 439 | "$(inherited)", 440 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 441 | "$(SRCROOT)/../node_modules/react-native-macos/React/**", 442 | ); 443 | INFOPLIST_FILE = PlexMusic/Info.plist; 444 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 445 | OTHER_LDFLAGS = ( 446 | "-ObjC", 447 | "-lc++", 448 | ); 449 | PRODUCT_NAME = PlexMusic; 450 | }; 451 | name = Release; 452 | }; 453 | 83CBBA201A601CBA00E9B192 /* Debug */ = { 454 | isa = XCBuildConfiguration; 455 | buildSettings = { 456 | ALWAYS_SEARCH_USER_PATHS = NO; 457 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 458 | CLANG_CXX_LIBRARY = "libc++"; 459 | CLANG_ENABLE_MODULES = YES; 460 | CLANG_ENABLE_OBJC_ARC = YES; 461 | CLANG_WARN_BOOL_CONVERSION = YES; 462 | CLANG_WARN_CONSTANT_CONVERSION = YES; 463 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 464 | CLANG_WARN_EMPTY_BODY = YES; 465 | CLANG_WARN_ENUM_CONVERSION = YES; 466 | CLANG_WARN_INFINITE_RECURSION = YES; 467 | CLANG_WARN_INT_CONVERSION = YES; 468 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 469 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 470 | CLANG_WARN_UNREACHABLE_CODE = YES; 471 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 472 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 473 | COPY_PHASE_STRIP = NO; 474 | ENABLE_STRICT_OBJC_MSGSEND = YES; 475 | ENABLE_TESTABILITY = YES; 476 | GCC_C_LANGUAGE_STANDARD = gnu99; 477 | GCC_DYNAMIC_NO_PIC = NO; 478 | GCC_NO_COMMON_BLOCKS = YES; 479 | GCC_OPTIMIZATION_LEVEL = 0; 480 | GCC_PREPROCESSOR_DEFINITIONS = ( 481 | "DEBUG=1", 482 | "$(inherited)", 483 | ); 484 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 485 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 486 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 487 | GCC_WARN_UNDECLARED_SELECTOR = YES; 488 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 489 | GCC_WARN_UNUSED_FUNCTION = YES; 490 | GCC_WARN_UNUSED_VARIABLE = YES; 491 | HEADER_SEARCH_PATHS = ( 492 | "$(inherited)", 493 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 494 | "$(SRCROOT)/../node_modules/react-native-macos/React/**", 495 | ); 496 | MACOSX_DEPLOYMENT_TARGET = 10.11; 497 | MTL_ENABLE_DEBUG_INFO = YES; 498 | ONLY_ACTIVE_ARCH = YES; 499 | SDKROOT = macosx; 500 | }; 501 | name = Debug; 502 | }; 503 | 83CBBA211A601CBA00E9B192 /* Release */ = { 504 | isa = XCBuildConfiguration; 505 | buildSettings = { 506 | ALWAYS_SEARCH_USER_PATHS = NO; 507 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 508 | CLANG_CXX_LIBRARY = "libc++"; 509 | CLANG_ENABLE_MODULES = YES; 510 | CLANG_ENABLE_OBJC_ARC = YES; 511 | CLANG_WARN_BOOL_CONVERSION = YES; 512 | CLANG_WARN_CONSTANT_CONVERSION = YES; 513 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 514 | CLANG_WARN_EMPTY_BODY = YES; 515 | CLANG_WARN_ENUM_CONVERSION = YES; 516 | CLANG_WARN_INFINITE_RECURSION = YES; 517 | CLANG_WARN_INT_CONVERSION = YES; 518 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 519 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 520 | CLANG_WARN_UNREACHABLE_CODE = YES; 521 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 522 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 523 | COPY_PHASE_STRIP = YES; 524 | ENABLE_NS_ASSERTIONS = NO; 525 | ENABLE_STRICT_OBJC_MSGSEND = YES; 526 | GCC_C_LANGUAGE_STANDARD = gnu99; 527 | GCC_NO_COMMON_BLOCKS = YES; 528 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 529 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 530 | GCC_WARN_UNDECLARED_SELECTOR = YES; 531 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 532 | GCC_WARN_UNUSED_FUNCTION = YES; 533 | GCC_WARN_UNUSED_VARIABLE = YES; 534 | HEADER_SEARCH_PATHS = ( 535 | "$(inherited)", 536 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 537 | "$(SRCROOT)/../node_modules/react-native-macos/React/**", 538 | ); 539 | MACOSX_DEPLOYMENT_TARGET = 10.11; 540 | MTL_ENABLE_DEBUG_INFO = YES; 541 | ONLY_ACTIVE_ARCH = YES; 542 | SDKROOT = macosx; 543 | VALIDATE_PRODUCT = YES; 544 | }; 545 | name = Release; 546 | }; 547 | /* End XCBuildConfiguration section */ 548 | 549 | /* Begin XCConfigurationList section */ 550 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "PlexMusic" */ = { 551 | isa = XCConfigurationList; 552 | buildConfigurations = ( 553 | 13B07F941A680F5B00A75B9A /* Debug */, 554 | 13B07F951A680F5B00A75B9A /* Release */, 555 | ); 556 | defaultConfigurationIsVisible = 0; 557 | defaultConfigurationName = Release; 558 | }; 559 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "PlexMusic" */ = { 560 | isa = XCConfigurationList; 561 | buildConfigurations = ( 562 | 83CBBA201A601CBA00E9B192 /* Debug */, 563 | 83CBBA211A601CBA00E9B192 /* Release */, 564 | ); 565 | defaultConfigurationIsVisible = 0; 566 | defaultConfigurationName = Release; 567 | }; 568 | /* End XCConfigurationList section */ 569 | }; 570 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; 571 | } 572 | -------------------------------------------------------------------------------- /macos/PlexMusic.xcodeproj/xcshareddata/xcschemes/PlexMusic.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 67 | 68 | 78 | 80 | 86 | 87 | 88 | 89 | 90 | 91 | 97 | 99 | 105 | 106 | 107 | 108 | 110 | 111 | 114 | 115 | 116 | -------------------------------------------------------------------------------- /macos/PlexMusic/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | #import "RCTBridge.h" 12 | 13 | @interface AppDelegate : NSObject 14 | 15 | @property (strong, nonatomic) NSWindow *window; 16 | @property (nonatomic, readonly) RCTBridge *bridge; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /macos/PlexMusic/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #import "AppDelegate.h" 2 | 3 | #import "RCTBridge.h" 4 | #import "RCTJavaScriptLoader.h" 5 | #import "RCTRootView.h" 6 | #import 7 | 8 | @interface AppDelegate() 9 | 10 | @end 11 | 12 | @implementation AppDelegate 13 | 14 | -(id)init 15 | { 16 | if(self = [super init]) { 17 | NSRect contentSize = NSMakeRect(200, 500, 1000, 500); // initial size of main NSWindow 18 | 19 | self.window = [[NSWindow alloc] initWithContentRect:contentSize 20 | styleMask:NSTitledWindowMask | NSResizableWindowMask | NSFullSizeContentViewWindowMask | NSMiniaturizableWindowMask | NSClosableWindowMask 21 | backing:NSBackingStoreBuffered 22 | defer:NO]; 23 | NSWindowController *windowController = [[NSWindowController alloc] initWithWindow:self.window]; 24 | 25 | [[self window] setTitleVisibility:NSWindowTitleHidden]; 26 | [[self window] setTitlebarAppearsTransparent:YES]; 27 | [[self window] setAppearance:[NSAppearance appearanceNamed:NSAppearanceNameAqua]]; 28 | 29 | [windowController setShouldCascadeWindows:NO]; 30 | [windowController setWindowFrameAutosaveName:@"PlexMusic"]; 31 | 32 | [windowController showWindow:self.window]; 33 | 34 | [self setUpApplicationMenu]; 35 | } 36 | return self; 37 | } 38 | 39 | - (void)applicationDidFinishLaunching:(__unused NSNotification *)aNotification 40 | { 41 | 42 | _bridge = [[RCTBridge alloc] initWithDelegate:self 43 | launchOptions:nil]; 44 | 45 | RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:_bridge 46 | moduleName:@"PlexMusic" 47 | initialProperties:nil]; 48 | 49 | 50 | 51 | [self.window setContentView:rootView]; 52 | } 53 | 54 | 55 | - (NSURL *)sourceURLForBridge:(__unused RCTBridge *)bridge 56 | { 57 | NSURL *sourceURL; 58 | 59 | #if DEBUG 60 | sourceURL = [NSURL URLWithString:@"http://localhost:8081/index.macos.bundle?platform=macos&dev=true"]; 61 | #else 62 | sourceURL = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; 63 | #endif 64 | 65 | return sourceURL; 66 | } 67 | 68 | - (void)loadSourceForBridge:(RCTBridge *)bridge 69 | withBlock:(RCTSourceLoadBlock)loadCallback 70 | { 71 | [RCTJavaScriptLoader loadBundleAtURL:[self sourceURLForBridge:bridge] 72 | onComplete:loadCallback]; 73 | } 74 | 75 | 76 | - (void)setUpApplicationMenu 77 | { 78 | NSMenuItem *containerItem = [[NSMenuItem alloc] init]; 79 | NSMenu *rootMenu = [[NSMenu alloc] initWithTitle:@"" ]; 80 | [containerItem setSubmenu:rootMenu]; 81 | [rootMenu addItemWithTitle:@"Quit PlexMusic" action:@selector(terminate:) keyEquivalent:@"q"]; 82 | [[NSApp mainMenu] addItem:containerItem]; 83 | } 84 | 85 | - (id)firstResponder 86 | { 87 | return [self.window firstResponder]; 88 | } 89 | 90 | @end 91 | -------------------------------------------------------------------------------- /macos/PlexMusic/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /macos/PlexMusic/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | $(MACOSX_DEPLOYMENT_TARGET) 27 | NSHumanReadableCopyright 28 | Copyright © 2015 29 | NSMainNibFile 30 | MainMenu 31 | NSPrincipalClass 32 | NSApplication 33 | ATSApplicationFontsPath 34 | Fonts 35 | NSAppTransportSecurity 36 | 37 | NSAllowsArbitraryLoads 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /macos/PlexMusic/main.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | #import "AppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) { 14 | @autoreleasepool { 15 | NSApplication * application = [NSApplication sharedApplication]; 16 | NSMenu *mainMenu = [[NSMenu alloc] initWithTitle:@"PlexMusic"]; 17 | [NSApp setMainMenu:mainMenu]; 18 | AppDelegate * appDelegate = [[AppDelegate alloc] init]; 19 | [application setDelegate:appDelegate]; 20 | [application run]; 21 | return EXIT_SUCCESS; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /macos/RNVectorIconsManager/RNVectorIconsManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // RNVectorIconsManager.h 3 | // RNVectorIconsManager 4 | // 5 | // Created by Joel Arvidsson on 2015-05-29. 6 | // Copyright (c) 2015 Joel Arvidsson. All rights reserved. 7 | // 8 | 9 | #import "RCTBridgeModule.h" 10 | #import "RCTLog.h" 11 | 12 | @interface RNVectorIconsManager : NSObject 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /macos/RNVectorIconsManager/RNVectorIconsManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // RNVectorIconsManager.m 3 | // RNVectorIconsManager 4 | // 5 | // Created by Joel Arvidsson on 2015-05-29. 6 | // Copyright (c) 2015 Joel Arvidsson. All rights reserved. 7 | // 8 | 9 | #import "RNVectorIconsManager.h" 10 | #import "RCTConvert.h" 11 | #import "RCTBridge.h" 12 | #import "RCTUtils.h" 13 | 14 | @implementation RNVectorIconsManager 15 | 16 | @synthesize bridge = _bridge; 17 | RCT_EXPORT_MODULE(); 18 | 19 | - (NSString *)hexStringFromColor:(NSColor *)color { 20 | const CGFloat *components = CGColorGetComponents(color.CGColor); 21 | 22 | CGFloat r = components[0]; 23 | CGFloat g = components[1]; 24 | CGFloat b = components[2]; 25 | 26 | return [NSString stringWithFormat:@"#%02lX%02lX%02lX", 27 | lroundf(r * 255), 28 | lroundf(g * 255), 29 | lroundf(b * 255)]; 30 | } 31 | 32 | 33 | RCT_EXPORT_METHOD(getImageForFont:(NSString*)fontName withGlyph:(NSString*)glyph withFontSize:(CGFloat)fontSize withColor:(NSColor *)color callback:(RCTResponseSenderBlock)callback){ 34 | CGFloat screenScale = RCTScreenScale(); 35 | 36 | NSString *hexColor = [self hexStringFromColor:color]; 37 | 38 | NSString *fileName = [NSString stringWithFormat:@"RNVectorIcons_%@_%hu_%.f%@@%.fx.png", fontName, [glyph characterAtIndex:0], fontSize, hexColor, screenScale]; 39 | NSString *filePath = [NSTemporaryDirectory() stringByAppendingPathComponent:fileName]; 40 | 41 | if(![[NSFileManager defaultManager] fileExistsAtPath:filePath]) { 42 | // No cached icon exists, we need to create it and persist to disk 43 | 44 | NSFont *font = [NSFont fontWithName:fontName size:fontSize]; 45 | NSAttributedString *attributedString = [[NSAttributedString alloc] initWithString:glyph attributes:@{NSFontAttributeName: font, NSForegroundColorAttributeName: color}]; 46 | CGSize iconSize = [attributedString size]; 47 | [attributedString drawAtPoint:CGPointMake(0, 0)]; 48 | 49 | NSImage *iconImage = [NSImage imageWithSize:iconSize flipped:YES drawingHandler:^BOOL(NSRect dstRect) { 50 | [glyph drawAtPoint:NSMakePoint(0, 0) withAttributes:@{NSFontAttributeName: font}]; 51 | return YES; 52 | }]; 53 | 54 | NSBitmapImageRep *rep = [[NSBitmapImageRep alloc] initWithCGImage:[iconImage CGImageForProposedRect:NULL context:nil hints:nil]]; 55 | NSData *imageData = [rep representationUsingType:NSPNGFileType properties:@{}]; 56 | 57 | 58 | BOOL success = [imageData writeToFile:filePath atomically:YES]; 59 | if(!success) { 60 | return callback(@[@"Failed to write rendered icon image"]); 61 | } 62 | } 63 | callback(@[[NSNull null], filePath]); 64 | 65 | } 66 | @end 67 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "PlexMusic", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "debug": "TARGET=Debug npm run build && npm run start", 7 | "release": "TARGET=Release npm run build && npm run start", 8 | "start": "macos/build/Products/$TARGET/PlexMusic.app/Contents/MacOS/PlexMusic", 9 | "build": "cd macos && xcodebuild build -scheme PlexMusic -configuration $TARGET -derivedDataPath .", 10 | "install": "cp -Rf macos/build/Products/$TARGET/PlexMusic.app /Applications", 11 | "lint": "eslint ." 12 | }, 13 | "dependencies": { 14 | "axios": "^0.15.3", 15 | "core-decorators": "^0.15.0", 16 | "lodash": "^4.17.2", 17 | "mobx": "^2.7.0", 18 | "mobx-react": "^4.0.4", 19 | "moment": "^2.17.1", 20 | "react": "15.4.1", 21 | "react-native-macos": "^0.12.0-alpha", 22 | "react-native-vector-icons": "^3.0.0", 23 | "thenby": "^1.2.3", 24 | "uuid": "^3.0.1", 25 | "xmldom": "^0.1.27" 26 | }, 27 | "devDependencies": { 28 | "babel-plugin-module-resolver": "^2.4.0", 29 | "babel-plugin-transform-decorators-legacy": "^1.3.4", 30 | "chai": "^3.5.0", 31 | "concurrently": "^3.1.0", 32 | "eslint": "^3.12.2", 33 | "eslint-config-airbnb": "^13.0.0", 34 | "eslint-plugin-jsx-a11y": "^2.2.3", 35 | "eslint-import-resolver-babel-module": "^2.2.1", 36 | "eslint-plugin-flowtype": "^2.29.1", 37 | "eslint-plugin-import": "^2.2.0", 38 | "eslint-plugin-lodash": "^2.2.5", 39 | "eslint-plugin-react": "^6.8.0", 40 | "eslint-plugin-react-native": "^2.2.1" 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knoopx/plex-music-react-native-macosx/cc965b8db32847bb9ba14f7ddb057e4c520383ad/screenshot.png -------------------------------------------------------------------------------- /src/App.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import React from 'react' 4 | import { action } from 'mobx' 5 | import { observer } from 'mobx-react/native' 6 | 7 | import { appState, account } from './Stores' 8 | import { LoadingView } from './UI' 9 | import { MainScreen } from './Screens' 10 | 11 | import type { LoginParams } from './Stores/Account/Types' 12 | 13 | @observer 14 | export default class App extends React.Component { 15 | componentWillMount() { 16 | this.performAutoLogin() 17 | } 18 | 19 | @action async performAutoLogin() { 20 | appState.isLoading = true 21 | 22 | let loginParams: ?LoginParams 23 | try { 24 | loginParams = await account.getLoginParams() 25 | if (loginParams) { 26 | await account.login(loginParams) 27 | } 28 | } finally { 29 | appState.isLoading = false 30 | } 31 | } 32 | 33 | render() { 34 | if (appState.isLoading) { 35 | return 36 | } 37 | return 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/Models/Album.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import { map } from 'lodash/' 4 | import { observable } from 'mobx' 5 | 6 | import Model from './Model' 7 | 8 | export default class Album extends Model { 9 | id: number 10 | @observable title: string 11 | @observable artistName: string 12 | @observable year: string 13 | @observable userRating: number 14 | @observable addedAt: number 15 | @observable playCount: number 16 | @observable tag: Array 17 | @observable genres: Array 18 | @observable artwork: ?string 19 | 20 | rate(rating: number) { 21 | return this.connection.rate(this.id, rating) 22 | } 23 | 24 | static parse(item, connection) { 25 | const { uri, localUri, port, device } = connection 26 | const thumbUrl = item.thumb && (`${localUri}${item.thumb}`) 27 | return new this(connection, { 28 | id: item.ratingKey, 29 | title: item.title.trim(), 30 | artistName: item.parentTitle.trim(), 31 | year: item.year, 32 | userRating: item.userRating, 33 | addedAt: item.addedAt * 1000, 34 | playCount: item.viewCount, 35 | tag: [], 36 | genres: map(item.Genre, e => e.tag.trim()), 37 | artwork: thumbUrl && (`${uri}/photo/:/transcode?url=${encodeURIComponent(thumbUrl)}&width=250&height=250&minSize=1&X-Plex-Token=${encodeURIComponent(device.accessToken)}`) 38 | }) 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/Models/Artist.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import { observable } from 'mobx' 4 | 5 | import Model from './Model' 6 | 7 | export default class Artist extends Model { 8 | id: number; 9 | @observable name: string; 10 | @observable addedAt: number; 11 | @observable artwork: string; 12 | 13 | static parse(item, connection) { 14 | const { endpoint, token } = connection 15 | const thumbUrl = item.thumb && (`${endpoint}${item.thumb}`) 16 | return new this(connection, { 17 | id: item.ratingKey, 18 | name: item.title.trim(), 19 | addedAt: item.addedAt * 1000, 20 | artwork: thumbUrl && (`${endpoint}/photo/:/transcode?url=${encodeURIComponent(thumbUrl)}&width=250&height=250&minSize=1&X-Plex-Token=${encodeURIComponent(token)}`) 21 | }) 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Models/Model.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import _ from 'lodash' 4 | import { Connection } from '../Stores/AppState/Connection' 5 | 6 | export default class Model { 7 | connection: Connection 8 | constructor(connection: Object, props: {}) { 9 | this.connection = connection 10 | _.assign(this, props) 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Models/Section.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import Model from './Model' 4 | 5 | export default class Section extends Model { 6 | id: number 7 | type: string 8 | name: string 9 | 10 | static parse(item, connection) { 11 | return new this(connection, ({ 12 | id: item.key, 13 | type: item.type, 14 | name: item.title 15 | })) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Models/Track.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import { observable } from 'mobx' 4 | 5 | import Model from './Model' 6 | 7 | export default class Track extends Model { 8 | @observable number: number; 9 | @observable title: string; 10 | @observable artistName: string; 11 | @observable albumId: number; 12 | @observable duration: number; 13 | @observable path: string; 14 | @observable url: string; 15 | 16 | static parse(item, connection) { 17 | const { uri, device } = connection 18 | const part = item.Media[0].Part[0] 19 | return new this(connection, { 20 | id: item.ratingKey, 21 | number: item.index, 22 | title: item.title.trim(), 23 | artistName: item.grandparentTitle.trim(), 24 | albumId: item.grandparentRatingKey, 25 | duration: item.duration, 26 | path: part.file, 27 | url: `${uri}${part.key}?X-Plex-Token=${encodeURIComponent(device.accessToken)}` 28 | }) 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Models/index.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import Album from './Album' 4 | import Artist from './Artist' 5 | import Track from './Track' 6 | import Section from './Section' 7 | 8 | export { Album, Artist, Track, Section } 9 | -------------------------------------------------------------------------------- /src/Screens/LoginScreen/DeviceList/DeviceListItem.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import React from 'react' 4 | import moment from 'moment' 5 | import { autobind } from 'core-decorators' 6 | 7 | import { action } from 'mobx' 8 | import { View, Text, TouchableOpacity } from 'react-native-macos' 9 | 10 | import Device from '../../../Stores/Account/Device' 11 | import { appState } from '../../../Stores' 12 | 13 | @autobind 14 | export default class DeviceListItem extends React.Component { 15 | props: { 16 | device: Device 17 | } 18 | 19 | @action async onPress() { 20 | try { 21 | await appState.connect(this.props.device) 22 | } catch (err) { 23 | // eslint-disable-next-line 24 | alert(err) 25 | } 26 | } 27 | 28 | render() { 29 | const { device } = this.props 30 | return ( 31 | 32 | 33 | 34 | {device.name} 35 | {moment(device.lastSeenAt).fromNow()} 36 | 37 | 38 | {device.product} ({device.productVersion}) 39 | {device.platform} ({device.platformVersion}) 40 | 41 | 42 | 43 | ) 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/Screens/LoginScreen/DeviceList/index.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import React from 'react' 4 | import _ from 'lodash' 5 | import { autobind } from 'core-decorators' 6 | 7 | import { View } from 'react-native-macos' 8 | 9 | import { Device } from '../../../Stores/Account' 10 | import DeviceListItem from './DeviceListItem' 11 | 12 | @autobind 13 | export default class DeviceList extends React.Component { 14 | props: { 15 | devices: Array 16 | } 17 | 18 | renderItem(device: Device) { 19 | return 20 | } 21 | 22 | render() { 23 | return ( 24 | 25 | {_.map(this.props.devices, this.renderItem)} 26 | 27 | ) 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Screens/LoginScreen/LoginView.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import React from 'react' 4 | import { observable } from 'mobx' 5 | import { observer } from 'mobx-react/native' 6 | import { autobind } from 'core-decorators' 7 | import { View, TextInput, Button } from 'react-native-macos' 8 | 9 | import { account } from '../../Stores' 10 | 11 | import type { LoginParams } from '../../Stores/Account/Types' 12 | 13 | @observer 14 | @autobind 15 | export default class LoginView extends React.Component { 16 | @observable loginParams: LoginParams = { 17 | login: '', 18 | password: '' 19 | } 20 | 21 | render() { 22 | return ( 23 | 24 | 25 | { this.loginParams.login = value }} 30 | /> 31 | { this.loginParams.password = value }} 36 | /> 37 |