GithubHelp home page GithubHelp logo

gtorrent / gtorrent-core Goto Github PK

View Code? Open in Web Editor NEW
39.0 18.0 12.0 2.44 MB

Core library of gTorrent which handles everything but UI/UX

License: GNU General Public License v3.0

CMake 4.72% C++ 94.27% Shell 1.00%

gtorrent-core's Introduction

gtorrent-core's People

Contributors

anataled avatar andrewberry avatar anon1efergwerfwer avatar ascent12 avatar avail avatar ben-connors avatar benwaffle avatar crimsonvoid avatar fatumlegion avatar fuyukaidesu avatar grimd34th avatar igi-111 avatar iitalics avatar infoburp avatar lluixhi avatar m-chojnacki avatar nyanpasu avatar penandlim avatar quaker762 avatar shinigamichan avatar truneet avatar voldyman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gtorrent-core's Issues

Standardize Utils

Maybe getTimeString(), getRateString() and such should be provided in their own namespace and have standard names and return values.

"Don't add torrent's name to path" option

Requesting a feature like that of rutorrent/rtorrent:
rutorrent screen

This would be useful for cross-seeding torrents. For example:
You have two torrent for 'lots of files'; torrent a and torrent b. Both torrents contain the same content. However, torrent a wants to create a directory called 'lots.of.files' while torrent b wants to create the directory 'lots_of_files'. To cross-seed in this situation, you would need to edit either torrent a's or torrent b's torrent file to match the directories.
With the "Don't add torrent's name to path" option, this would not be a problem. Users would not need to edit torrent files which in turn means cross-seeding with trackers that check torrent hashes would be possible.

0.1.0

Issue by nyanpasu
Wednesday Jul 16, 2014 at 18:25 GMT
Originally opened as https://github.com/gtorrent/gTorrent-legacy/issues/41


The following list is almost done. Right now I'm polishing the rough edges. But I still am accepting suggestions to add to the list.

If you feel like a feature should belong in #70 feel free to move it there or comment down here if you can't.

Features

Bug fixes

Added incrementally as they are found.

Other TODOs

  • Work on more flags for cmake
    • Debug mode
    • Enable/Disable console screen on Windows
  • Distributable binaries for Windows
  • .deb package files for Debian/Ubuntu

Notes

To prevent features getting their own special unique 0.0.X, it's much better if you make a PR to a branch just for your own feature, so that when we do increment 0.0.X we can do it together with a bunch of other features that have also been confirmed to work.

Notes: Please try to work on this issues on a separate branch so that you can create partial PRs for other people to test before we actually merge it into master. When we merge into master the following should be done:

  • Increment version 0.0.X in CMakeLists.txt
  • Update CHANGELOG with features added in that version

Central communication

Hey guys, great to see the project starting back up. I'm going to start contributing again soon. Is there a place that we can all talk? Is the IRC dead?

Cross platform home directory

Issue by nyanpasu
Thursday Jul 17, 2014 at 16:34 GMT
Originally opened as https://github.com/gtorrent/gTorrent-legacy/issues/77


We have a partial implementation of this.

On GNU/Linux: We will be using $XDG_CONFIG_HOME/gtorrent which usually translates to ~/.config/gtorrent

This is the working directory of gTorrent, it's where it will store:

  • Session data
  • Config data

On Windows: We will use %APPDATA%\gtorrent -- No, let's not forget how retarded some Windows babbies can get. Some anon suggests %APPDATA%\gtorrent for session related data and the user's home directory for configuration files. I +1 that.

On Mac: See GNU/Linux.

Obviously the fact that we'll have to split up where user configs and session data is stored makes this irritating as we can't use the same DIR. Therefore, on all core systems, there'll be two MACROs used to define where config/session data is stored, even if it is the same on GNU/Linux and Mac.

Use math instead of if/else

Issue by benwaffle
Saturday Jul 19, 2014 at 00:44 GMT
Originally opened as https://github.com/gtorrent/gTorrent-legacy/issues/103


from some guy on IRC, can we test + merge this?

if( downloaded <= 0 )
{
    ttd << string();
}
else
{
    const string suffixes[] = { " B", " KB", " MB", " GB" };
    const int maxoffset = sizeof( suffixes ) / sizeof( suffixes[0] );
    int offset = floor( log( downloaded ) / log( 1024 ) ); 
    if( offset >= maxoffset )
        offset = maxoffset - 1;

    ttd << fixed << setprecision(3) << downloaded / pow( 1024, offset ) << suffixes[offset];
}
return ttd.str();

Save session state

Issue by nyanpasu
Thursday Jul 17, 2014 at 14:38 GMT
Originally opened as https://github.com/gtorrent/gTorrent-legacy/issues/69


Similar to #59, but not exactly the same.

This feature offers the ability to store the current list of torrents and their statuses/properties preferably in gTorrent's own home directory and load them again the next time gTorrent is run.

This feature should still work if gTorrent is closed due to unexpected crashes, else an angry mob will lynch us.

stack overflow

  • if process doesn't have write permissions to create files in .config/gtorrent
  • if process doesn't have write permissions to create the folder .config/gtorrent

Plugin System

While maybe not too critical just yet, we should start to think of how we would like to handle our plugin architecture. Our plugins should not be shipped as a dll or so file as we can't ensure that plugin authors would be willing to release source or target every platform.

If we decide to go this approach, that leaves us two strong scripting language canidates, Python or Lua.

  • Lua
    • Small, easy to understand.
    • Just the features we would need to provide quick access to our core. (maps, maths, web requests, etc)
  • Python
    • Xbauxhueg, easy to understand
    • Many features, probably most we wouldn't use or ever need for our plugin system

What do you guys think? I'd love to start working on a branch and an RSS plugin as an example.

Issue with building as git submodule

The way the all.h header file is included, using the CXX_FLAGS and as a relative path in the CMakeFile makes it so this can not be built as a submodule, or any other time cmake is ran outside of the main directory.

0.2.0

Issue by nyanpasu
Thursday Jul 17, 2014 at 15:16 GMT
Originally opened as https://github.com/gtorrent/gTorrent-legacy/issues/70


Hold it, you might think. We haven't even released 0.1.0 yet, why are you making an issue for 0.2.0?

The purpose of this issue to take features we have come up with while working on 0.1.0 that we've noticed aren't appropriate for 0.1.0, so that we can move it here and forget about it and work on it later.

Features (draft)

  • Plugins for all your stupid bloat.

Travis crashes randomly while downloading packages

Issue by nyanpasu
Thursday Jul 17, 2014 at 15:25 GMT
Originally opened as https://github.com/gtorrent/gTorrent-legacy/issues/72


Example:

Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/u/upstart/upstart_1.13-0ubuntu1_amd64.deb 404 Not Found [IP: 2001:67c:1562::13 80]

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

A simple script should be used to either
A. Keep trying over and over agian, until it werks, wwww
B. Wait between each dependency download (? Will this actually help?)

Nonetheless, a script should be used to check why fetching has failed and to reattempt the update if it can establish that the error won't be repeated if a retry is made.

Notes: I have enabled caching but I see no hard evidence. In the event of confirming that Travis actually caches apt-get downloads, this issue can be closed.

incorrect error message

If .config/gtorrent is owned by root, the message printed out is "process is not unique" (even though it is)

There's absolutely no reason to use recursion in processIsUnique()

Unit tests

[ ] Choose a unit-testing framework
[ ] Write tests

inb4 gt-core too small for unit-tests
can't hurt m8

Implement a modules system

Issue by ascent12
Wednesday Jul 16, 2014 at 10:48 GMT
Originally opened as https://github.com/gtorrent/gTorrent-legacy/issues/34


One of the original goals was to have a modules/plugins system to have 'optional features' that a user could install, and not have the client be bloated with features that a user does not want or use. It also opened up the possibility of non-gtorrent developers easily extending the client. It's pretty much the same thing that rutorrent does with their plugins.

Using Lua for the plugins was talked about, because it's very lightweight to ship the interpreter, but other languages like Python would work too.

Ideas for modules that could be implemented is:

  • RSS automation
  • Traffic monitoring
  • Torrent swarm statistics
  • GeoIP
  • Automated tools (moving, renaming etc.)
    Or just copy most of the stuff here

I think we need to decide how (or if) a modules system is going to be implemented into the clients, hopefully in a toolkit-independent way. The earlier this is done, the better, as it allows for a lot more work to start happening once it is finished.

redundant code

void gt::Platform::makeSharedFile()
{
    if(processIsUnique() && !checkDirExist("/tmp/gfeed")) //If the pipe already exists we'll just use it
        if(mkfifo("/tmp/gfeed", 0755) == -1)
            throw std::runtime_error("Couldn't create pipe! Check your permissions or if /tmp/gfeed exists");
    fd = open("/tmp/gfeed", O_RDONLY | O_NONBLOCK); // TODO: use streams
    if(fd == -1)
        throw std::runtime_error("Couldn't open pipe");
    if(ld == -1)
        ld = open("/var/lock/gtorrent.lock", O_CREAT | O_RDONLY, 0600);
    if(ld == -1)
        throw std::runtime_error("Couldn't open pipe");
    processIsUnique(); // a call here to lock the file
}
  • /var/lock/gtorrent.lock is not the path we use for the lock
  • the ld == -1 checks are redundant since processIsUnique will not return until ld != -1

Removing gtorrent-core

This is a legitimate post.

gtorrent-core is a formatting layer and that's about it. Most of the code that isn't remapping the libtorrent api is for features like file association, string formatting and core related setting files.. all of which are UI/UX related and should be client based code.

Why restrict the GUI developers by having them map libtorrent API calls from gtorrent-core then send a PR? Instead of poking holes in the wall when necessary just remove the whole damn wall.

I propose we remove the entire gtorrent-core code base and shift the scope of the gtorrent project to focus on the GUI development of gtorrent, using libtorrent directly. The whole purpose of this project was to create a torrent client that was lightweight and not bloated with adware, or, the utorrent killer.

I've spoken to fuyukaidesu on #gtorrent about this and he couldn't come up with any real reasons to keep gtorrent-core other than it being bothersome to switch the gtk branch over to using pure libtorrent.

gt-core design specification

I think we need to put our heads together and come up with a solid specification for the gt-core and it's interfaces.

Once we have the spec down, the gt-core code base will be much easier to maintain and we won't have all these merge problems where we end up with multiple accessors for the same variables (see: Torrent::getSize()/getWanted()/getTorrentSize()).

Also we'll have some real documentation- new UIs will be much easier to create.

Alternative to global static settings dictionary map for config

Current implementation is a hash map with string keys to string values.

It's simple, but not effective.

Also a hash map is so fucking noob.

I propose creating a new class called SettingsOption, which will contain:

  • Name
  • Value
  • Description (optional)
  • Type (optional)
  • Permitted values (i.e range, string regex)
  • Callback functions that will be called when a change occurs (so that any function could register for changes in option)

This could allow the config file to be self documenting when it's first generated.

Even though most config options should be self documenting by name alone.

Along the way we could consider:

  • SettingSection (settingOption can be grouped by category)

The current Setting class will be replaced with a abstract Setting parent that will contain:

  • init
  • clean up
  • default
  • read/parse
  • write/update/generate

And other modules will inherit from it, adding their own options.

style check + static analysis

We should use cpplint for conformance with google's C++ style guidelines.
cppcheck and clang's analyzer for detecting logic bugs

File association should be performed during installation

Currently association is done in gt::Platform::associate

where the files ~/.local/share/applications/gtorrentt.desktop and ~/.local/share/applications/gtorrentm.desktop are created, generated and written.

After gtorrent gets typically uninstalled by the casual user, these desktop entries remain behind, like unpleasant love marks.

use Boost libraries

parts of boost we might use:

  • Filesystem
  • Program Options
  • Log
  • Test (if we ever write unit tests)

some of this is part of TR2...how do the TRs work?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.